Skip to content

Latest commit

 

History

History
65 lines (64 loc) · 1.63 KB

readme.md

File metadata and controls

65 lines (64 loc) · 1.63 KB

Python 3.10.10

How to run app

  1. up DB and broker
docker compose up -d --build
  1. install requirements
  2. export env variables
export $(grep -v '^#' .env | xargs)
  1. Create DB tables and fill_handbooks
python manage.py alchemy_create api
python manage.py fill_handbooks
  1. up app
python manage.py runserver
  1. up celery
celery -A core.celery_config worker -l INFO
  1. 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
    }
}

How to run tests

  1. install requirements-dev.txt
  2. run tests
pytest tests

Для запуска тестов в параллель использовать комманду

pytest -n auto