This is a small django application, introducing online catalog of products with categories and brands. In plans: a cart and mail notifications services
- python 3.8+ installed
- psql connection available
python3 -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
- Create .env file and populate it with values. Please check .env.example for reference
- Run initial database commands:
python3 manage.py migrate python3 manage.py createsuperuser
- Run collect static command
python3 manage.py collectstatic
- How to sync migrations and database
pg_restore -U postgres -h 0.0.0.0 -d xxxx < dump.dump --disable-triggers rm -rf catalog/migrations rm -rf files/migrations python manage.py makemigrations python manage.py migrate pg_dump --column-inserts --data-only -h 0.0.0.0 -U postgres -W -Fc xxxx > dump.dump
replace "xxxx" with DB_NAME and "postgres" with your DB_USER
- Redis
start
stop
redis-server
flush cacheservice redis-server stop
redis-cli flushall
python3 manage.py runserver