Code Monkey home page Code Monkey logo

trad's Introduction

📕 FastAPIUsers

Подготовка окружения

make init
docker-compose up -d redis db    
alembic upgrade head

или

make init
make up-db

Запуск

export SMTP_USER=<адрес почты>
export SMTP_PASS=<токен почты>

source .venv/bin/activate
uvicorn src.main:app --reload

Тесты и Линтеры

Линтеры

make pretty

Tavern тесты - пока не работает

tavern-ci tests/tavern --alluredir=/tmp/allure --clean-alluredir

Pytest тесты

для тестов используется отдельная БД, на 6000 порту

docker-compose up -d test_db    
DB_ENV='test' alembic upgrade head
pytest -sv tests/

Использование

Регистрация

Рандомные данные

https://www.coderstool.com/sql-test-data-generator

INSERT INTO operation
VALUES ('1', '23', 'QWER12', 'bond', '2022-04-10 09:18:10', 'Coupons');

Добавить роли

insert into role values (1, 'user', null), (2, 'admin', null);

POST /auth/register

{
  "email": "user",
  "password": "user",
  "is_active": true,
  "is_superuser": false,
  "is_verified": false,
  "username": "user",
  "role_id": 1
}

Celery

Чтобы развернуть Celery

celery -A src.tasks.tasks.celery worker -D
celery -A src.tasks.tasks.celery flower

или

make celery-start

чтобы оставновить воркер

make celery-stop

trad's People

Contributors

alexe0110 avatar

Watchers

 avatar

trad's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.