- Install docker https://docs.docker.com/
- Install docker compose https://docs.docker.com/compose/install/
- Clone project directory:
git clone
- Create environment variables file in main directory typing command:
touch .env
- Populate .env according to the Environment Variables Setup section.
- Run
docker-compose build
- Run
docker-compose run web python manage.py migrate
- Create admin by typing command:
docker-compose run web python manage.py createsuperuser
- Start server and app by command:
docker-compose up
- Server is active at http://localhost:{WEB_PORT}. WEB_PORT must be set in .env file.
- Run
pytest
to start tests. - Run
black .
to auto-reformat code. - Run
isort .
to auto-sort all imports
User environment variables file (.env) should be created as described below:
Postgres
POSTGRES_DB=POSTGRES DATABASE NAME
POSTGRES_USER=POSTGRES DATABASE USER
POSTGRES_PASSWORD=POSTGRES DATABASE PASSWORD
Django
SECRET_KEY=DJANGO_SECRET_KEY
DEBUG=DEBUG MODE (default False) # Optional
WEB_PORT=WEB APPLICATION PORT NUMBER
Django Database
HOST=DATABASE SERVICE NAME
PORT=DATABASE PORT NUMBER
Celery
CELERY_LOG_LEVEL=LOGGING LEVEL (DEBUG, INFO, WARNING, ERROR, CRITICAL, or FATAL)
Sendgrid
SENDGRID_API_KEY=API KEY FROM SENDGRID
SENDGRID_REGISTRATION_TEMPLATE_ID=TEMPLATE ID OF THE EMAIL TEMPLATE FROM SENDGRID
SENDGRID_SENDER_EMAIL=SENDGRID REGISTERED SENDER EMAIL ADRESS
User activation endpoint link expiration
ACTIVATION_LINK_EXPIRATION_TIME=ACTIVATION LINK EXPIRATION TIME IN MINUTES (default 60) # Optional
JWT access and refresh tokens expiration time
ACCESS_TOKEN_LIFETIME=ACCESS TOKEN EXPIRATION TIME IN MINUTES (default 15) # optional
REFRESH_TOKEN_LIFETIME=ACCESS TOKEN EXPIRATION TIME IN HOURS (default 24) # optional
Basket expiration time
BASKET_EXPIRATION_TIME=BASKET EXPIRATION TIME IN DAYS (default 30) # optional