Recruitment task
To properly run the project poetry is highly recommended. Instructions
on how to do it are available at the bottom of README.
requests - connection to external api
djangorestframework - used to provide basic behaviour to all REST stuff
flake8 - code formatting
isort - autoformatting imports
black - reformatting code (fixing line breaks, quotes)
gunicorn - used to reduce strain on server
pytest - used for writing test
psycopg2 - used because of postgres db being used by app
python-decouple - separation of sensitive info, easier split between dev and prod env
DJANGO_KEY=nb-=b1lif_low2c#w&!ly9($u68k$oamnv7u2mpu5!0%tmv+5)
DEBUG=False
DB_NAME=cars
DB_TEST_NAME=cars_test
DB_USER=ngru
DB_PASSWORD=ngru_postgres
DB_PORT=5430
DB_HOST=127.0.0.1
python manage.py migrate
python manage.py runserver
docker-compose up --build
Run pytest .
. The results will be listed in the terminal.
Any models to makemigrations?
Any unapplied migrations?
Run pytest .
. The results will be listed in the terminal.
To run only a category of tests append: -m
and specify which tests to run.
- unit
- integration
You can combine the categories with or
keyword ex. pytest -m "unit or integration" .
flake8
- check stylistics
black .
- reformat all
isort .
- sort import accordingly to the project's rules
Install the tool
Install the dependencies
Set env
Run inside env
Build
Update