Application example of COAX Python Bootcamp project explained in lectures.
Link to the example of environments
The infrastructure of Optinet project consists of the following services:
- Premier Watcher project application (monolith)
- PostgreSQL database
- Celery
- Redis
- Docker
- ElasticSearch
- SMTP for mails
# Run non-applied migrations
python manage.py migrate
# Collect static into Storage
python manage.py collectstatic --no-input
# When ES enabled, use this command to rebuild indices
python manage.py search_index --rebuild
# Create superuser
python manage.py createsuperuser
# To enter interactive Django shell
python manage.py shell -i=python
- Install the docker and docker-compose.
- Create the directory
.env
in the root project directory and paste the filevars
inside the.env
. Put the needed environments tovars
. - Run the project
docker-compose -f docker-compose.dev.yml up --build
- Install Python 3.9
- Install PostgreSQL 12.3
- Install Redis 6.2.5
- Install ElasticSearch
pipenv install
python manage.py collectstatic
python manage.py migrate --no-input
python manage.py runserver
ELASTICSEARCH_DSL_AUTO_REFRESH=False
ELASTICSEARCH_DSL_SIGNAL_PROCESSOR=index.signals.FakeSignalProcessor
For testing purposes we need all variables defined above.
We need to set ELASTICSEARCH_DSL_AUTO_REFRESH=False
not to force tests run very slowly.
We need to set ELASTICSEARCH_DSL_SIGNAL_PROCESSOR=index.signals.FakeSignalProcessor
to force tests
run as usual.
flake8 .
...