-
Notifications
You must be signed in to change notification settings - Fork 6
Installation without docker
- Python (any version matching the ones specified here
grep python-version .github/workflows/django.yml
). - Virtualenv (e.g. python3-venv package from your distro's repositories).
- PostgreSQL database (Django framework will administer tables inside it).
- E-mail server, Open port, TLS certificates, DNS routing, Reverse Proxy, Backup strategy, etc.
Execute these commands as the user that will be running/ exposing the application.
Note that the default branch is 'develop'. We dropped main to ease the development among contributors. If you wanted to get one of the stable releases, please do so by adding --branch 1.0.0
to git-clone
. Do so with an appropriate version number from releases.
git clone --depth=1 git@github.com:maxplanck-ie/parkour2.git
python3 -m venv env_app
source ./env_app/bin/activate
pip install -r parkour_app/requirements/prod.txt
Now the core installation is done, you may move forward.
We assume some environmental variables are set (e.g. LANG
, LC_TIME
, TZ
, etc.) ... Next, you'll need to set further environmental variables (use export
so that these are inherited by downstream processes). Take a look at misc/parkour.env.sample
to get an idea of what you'll need (e.g. DATABASE_URL
is read by Django to authenticate with your PostgreSQL instance).
Next, change directory into the parkour_app/
subfolder. From now on, all commands will assume this positioning.
At last, run the application (in this example, using 4 workers and binding it to port 8000 of all available IP addresses, to be taken care afterward by a web server running as a reverse proxy). See Green Unicorn's Official Documentation for further details.
gunicorn wui.wsgi:application -t 600 -w 4 -b :8000
At this point, the database is empty. Before populating it, we'd need to define the schema (e.g. creating empty tables, defining relation between columns/ foreign keys, etc.) For this, run python manage.py migrate --traceback
. The command will run all the django-generated code matching the Model definitions of our application (e.g. files matching parkour_app/**/migrations/*.py
)
For the first login, create an admin account with the following command: python manage.py createsuperuser
. You'll be asked for an email account, and a password (twice).
There's some default data that will be useful and required, run python manage.py load_initial_data
. You may edit fixtures manually (e.g. files matching parkour_app/**/fixtures/*.json
). Please note that since the primary keys (pk) are defined in such files; every time you re-load these JSON Fixtures, the database is gracefully overwritten on these items. You might prefer saving customizations with pg_dump
.
Finally, further populate your database according to your needs (see the user manual for details, or check Django's loaddata
administrative command). Use the cog icon in the top-right corner to access the 'Site Admin' panel.
Take a look at other administrative commands, like django-admin dumpdata
and/ or pg_dump
& pg_restore
. Even if you're not using docker, running make help
for a list, and spying upon these with dry-run (e.g. make -n save-postgres
) is highly encouraged!