Check your python version. This project runs on 3.11.4:
python --version
If you do not have it, you can use a tool such as pyenv
to install it.
How to install pyenv on:
pyenv install 3.11.4
- Run
poetry config virtualenvs.in-project true
- If you have pyenv installed run
poetry config virtualenvs.prefer-active-python true
- To activate your python virtualenv run
poetry shell
- Run
poetry install
poetry add package-name
To run redis locally do:
docker run -d --name local-redis -p 6379:6379 redis:latest
By default, it is running on port 3884.
poetry run start
- Run
export FLASK_APP=main:create_app
or add it to your .bashrc/.zshrc file - Run
flask db init
in the/src
folder
- Run
flask db stamp head
this indicates that the current state of the database represents the application of all migrations.
- Make changes to the classes located in the
/database/models
folder - After you have made a change do:
flask db migrate -m "Migration message"
- To apply the changes described by the migration script to the database do:
flask db upgrade
We use Celery to execute background tasks such as sending emails, extracting the user data, and other long-running tasks.
The Celery worker is responsible for executing tasks that are added to the task queue. The Celery Beat service is a scheduler that sends tasks to the worker at regular intervals In order fo Celery to execute tasks both immediately and on a schedule, both services should be running concurrently.
celery -A "src.celery_task_queue.make_celery" worker --autoscale=8,1 --loglevel INFO
celery -A "src.celery_task_queue.make_celery" beat --loglevel INFO