3.9
python -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
Just press F5 (Config is inside keep-learning.code-workspace
)
Please contribute if you know how.
Default variables should work out of the box already, but in case you want to customize, here is how.
Add .env
file and write your custom variables to it.
Available variables and their data type can be seen in keep_learning/settings.py
:
env = environ.Env(
... # Variables are listed here
)
You can login to the browsable API and explore it to help with development.
python manage.py collectstatic
Go to this URL in your brower. (You may need to register new user and then login if you haven't already)
http://localhost:8000/
NOTE This is only needed if you develop features involving background tasks, like sending email, .etc
docker run -d --name rabbitmq -p 5672:5672 rabbitmq
Exec into container
docker exec -it rabbitmq bash
Create user, vhost
rabbitmqctl add_user kl_user kl_password
rabbitmqctl add_vhost kl_vhost
rabbitmqctl set_permissions -p kl_vhost kl_user ".*" ".*" ".*"
celery --app keep_learning worker --loglevel INFO --pool solo
NOTE Every time you make changes to a task, celery worker should be restarted.
In development, emails are not actually sent, but instead saved to temp/sent_emails
.
You can inspect this directory to test email sending features.