Skip to content

urbonegi/eshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e-Shop Menu Application

e-Shop like Application managing Products and Categories tree menu for Python 3.5

Requires django 1.10 and psycopg2 libraries

Getting started

Running unit tests

Using tox basic dependencies are installed. Unit Tests uses in-memory DB.

pip install tox
tox -r

Install application dependencies

pyvenv env
. env/bin/activate
pip install -r requirements_run.txt

Setup postgres DB

Create eshop database and eshopuser. Assuming postgres DB on localhost. Modify database settings @ eshop/settings.py

CREATE DATABASE eshop;
CREATE USER eshopuser WITH PASSWORD 'password';
ALTER ROLE eshopuser SET client_encoding TO 'utf8';
ALTER ROLE eshopuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE eshopuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE ehop TO eshopuser;

###Running migrations

python eshop/manage.py migrate

Running stress test

Testing application performance when 10 000 active products added to the DB with many categories and subcategories

python eshop/manage.py stress_test

Running unit test manually

python eshop/manage.py test --settings eshop.test_settings

Create application superuser

python eshop/manage.py createsuperuser

Running web application

python eshop/manage.py runserver

Application Overview

Application specification doc is here. Application display Read-Only Menu of active Products and Categories @ index url. Under /admin site logged in users are allowed to add Categories and Products.

Additional behaviour assumptions done:

  • Model Validations added
    • Category can not be a parent for itself
    • Sub_categories can not be assigned to multiple categories
  • If product is inactive it is not shown in Read-Only Menu and not included to the 'active product count' (N)
  • DB is optimize to read data: Create and Delete new products and categories can take quite long time to optimise retrieve of data (db_index used)
  • Product can be added to different categories multiple times, then total product count adds it multiple times

About

e-Shop like application managing products and categories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published