- up DB and broker
docker compose up -d --build
- install requirements
- export env variables
export $(grep -v '^#' .env | xargs)
- Create DB tables and fill_handbooks
python manage.py alchemy_create api
python manage.py fill_handbooks
- up app
python manage.py runserver
- up celery
celery -A core.celery_config worker -l INFO
- Check everything is ok
curl --location 'http://127.0.0.1:8000/api/auth/auth/' \
--header 'Content-Type: application/json' \
--data-raw '{
"engine": "email",
"credentials": {
"email": "super_admin@example.com",
"password": "StrongPass777"
}
}'
Example response
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMjQxNzE1YzMtY2UxMi00MTYxLTgwZGEtYmFlYmUwYzU5MGE5IiwiZXhwIjoxNjg1ODIyMjg1fQ.o45cS8Upwz562l5XNmgzaOMz3mZUe0dr8Ea7LnM_lxM",
"user": {
"time_created": 1685562975,
"time_updated": 1685562975,
"user_id": "241715c3-ce12-4161-80da-baebe0c590a9",
"user_type": "SUPER_ADMIN",
"email": "super_admin@example.com",
"is_email_confirmed": true,
"last_name": "super",
"first_name": "admin",
"is_confirmed": true,
"is_blocked": false
}
}
- install requirements-dev.txt
- run tests
pytest tests
Для запуска тестов в параллель использовать комманду
pytest -n auto