-
Notifications
You must be signed in to change notification settings - Fork 6
Contributing
After completing installation and running the basic local deployment, you may be wondering: How do I start contributing new code?
Remember, all
make
commands prependdocker exec [-it] <container-name> <command>
. But you'll need to use this yourself if you need to run commands inside the container. For example, starting an interactive root bash shell:docker exec -it parkour2-django bash
.
Use make dev-easy schema
, and then run manage.py createsuperuser
(inside the container, of course). All your changes to the code will be automatically reloaded, for live debugging. If you encounter errors during your work, a shell is available thanks to Werkzeug.
You can also work without Docker, for that you'd need to use DJANGO_SETTINGS_MODULE=wui.settings.dev
in misc/parkour.env
, and create a python virtual environment with all the dependencies from parkour_app/requirements/dev.txt
. Finally, load the environmental variables with set +a; source misc/parkour.env; set -a
, and run the server with python parkour_app/manage.py runserver_plus 0.0.0.0:8000
.
Also, we are using pre-commit
, please remember to install the tool and the hook after cloning the repo so that all the scripts (e.g. Black code formatter) are run before any code is added to an actual commit. Run make env-setup-dev
to install both pre-commit and pip-compile-multi under a python virtual environment in the root of the repo that's already added to the git ignore. For this rule to work, in some distros you'll need python3-venv
package (of course, package name varies from distro to distro).
If you needed to add new dependencies to the requirements/*.txt
files, please do so by the means of the *.in
files and use the pip-compile-multi
tool to "compile" (lock version numbers) to the *.txt
file(s).