2020-09-21 13:31:02 +02:00
# foerderbarometer
2020-10-20 09:35:04 +02:00
purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a database ('förderdatenbank') and send emails with links for a questionary.
2020-10-01 10:19:17 +02:00
2020-11-16 15:53:43 +01:00
## installation and development setup
2020-10-26 12:26:41 +01:00
2020-11-16 15:53:43 +01:00
ln -sr foerderbarometer/settings_development.py foerderbarometer/settings.py
2020-11-17 13:23:07 +01:00
2020-11-16 15:53:43 +01:00
run the development server with
python3 manage.py runserver
2020-10-26 12:26:41 +01:00
2020-11-06 12:13:50 +01:00
## versions used in development
2020-10-01 10:19:17 +02:00
2020-10-26 12:26:41 +01:00
python 3.8.2
django 3.1.1
django-formtools 2.2
2020-11-09 16:04:36 +01:00
whitenoise 5.2.0
2020-11-09 16:28:41 +01:00
gunicorn 20.0.4
2020-11-06 12:11:38 +01:00
2020-11-06 12:13:50 +01:00
## production setup
2020-11-06 12:11:38 +01:00
2020-11-16 15:53:43 +01:00
ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py
2020-11-06 12:11:38 +01:00
2020-11-09 16:04:36 +01:00
edit /secrets.json to contain something similar to
2020-11-12 12:05:28 +01:00
{
2020-11-17 13:23:07 +01:00
"DATABASE_PASSWORD": "THIS IS TOP SECRET!",
"SECRET_KEY": "THIS IS ANOTHER SECRET!"
2020-11-12 12:05:28 +01:00
}
edit foerderbarometer/settings_production.py according to your database setup (tested with MariaDB 10.0.36)
run the following commands:
2020-11-09 16:04:36 +01:00
2020-11-16 15:53:43 +01:00
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py collectstatic
2020-11-09 16:04:36 +01:00
2020-11-12 12:05:28 +01:00
add to cron at least one time a day:
2020-11-09 16:04:36 +01:00
2020-11-16 15:53:43 +01:00
python3 manage.py sendmails
2020-11-09 16:28:41 +01:00
server starts with
2020-11-12 12:05:28 +01:00
nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' foerderbarometer.wsgi 2& > logfile &
2020-11-16 15:53:43 +01:00
Should be executed at least daily e.g. in crontab
python3 manage.py sendmails