2020-09-21 11:31:02 +00:00
# foerderbarometer
2020-10-20 07:35:04 +00: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 08:19:17 +00:00
2020-11-16 14:53:43 +00:00
## installation and development setup
2020-10-26 11:26:41 +00:00
2020-11-16 14:53:43 +00:00
ln -sr foerderbarometer/settings_development.py foerderbarometer/settings.py
2020-11-24 12:44:07 +00:00
build the database with
2020-11-23 16:16:03 +00:00
2020-11-24 12:49:37 +00:00
python3 manage.py migrate
2020-11-23 16:16:03 +00:00
2020-11-24 09:04:46 +00:00
create superuser account with
2020-11-24 12:49:37 +00:00
python3 manage.py createsuperuser
2020-11-24 09:04:46 +00:00
2020-11-16 14:53:43 +00:00
run the development server with
2020-11-24 12:49:37 +00:00
python3 manage.py runserver
2020-11-24 12:44:07 +00:00
2020-11-24 09:04:46 +00:00
access via
2020-11-24 12:52:12 +00:00
http://localhost:8000/
http://localhost:8000/intern/ (login required)
http://localhost:8000/admin/ (login reqiured)
2020-10-26 11:26:41 +00:00
2020-11-24 12:44:07 +00:00
## additional admin functionality
The admin page is the standard admin page delivered by django but with two additional functionalities:
- There is a new action "export to csv" with which you can export all Selected
entries to a csv file
- There is a new button in the bottom of every Project to "save as new"
2020-11-06 11:13:50 +00:00
## versions used in development
2020-10-01 08:19:17 +00:00
2020-10-26 11:26:41 +00:00
python 3.8.2
2021-06-21 16:05:10 +00:00
django 3.1.x (does not work with django 3.2 in the moment!)
2020-10-26 11:26:41 +00:00
django-formtools 2.2
2020-11-09 15:04:36 +00:00
whitenoise 5.2.0
2020-11-09 15:28:41 +00:00
gunicorn 20.0.4
2020-11-06 11:11:38 +00:00
2020-11-23 16:16:03 +00:00
## testing
run some tests with
python3 manage.py test
2020-11-06 11:13:50 +00:00
## production setup
2020-11-06 11:11:38 +00:00
2020-11-16 14:53:43 +00:00
ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py
2020-11-06 11:11:38 +00:00
2020-11-09 15:04:36 +00:00
edit /secrets.json to contain something similar to
2020-11-12 11:05:28 +00:00
{
2020-11-17 12:23:07 +00:00
"DATABASE_PASSWORD": "THIS IS TOP SECRET!",
"SECRET_KEY": "THIS IS ANOTHER SECRET!"
2020-11-12 11:05:28 +00:00
}
edit foerderbarometer/settings_production.py according to your database setup (tested with MariaDB 10.0.36)
run the following commands:
2020-11-09 15:04:36 +00:00
2020-11-16 14:53:43 +00:00
python3 manage.py migrate
python3 manage.py collectstatic
2020-11-09 15:04:36 +00:00
2020-11-09 15:28:41 +00:00
server starts with
2020-11-12 11:05:28 +00:00
nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' foerderbarometer.wsgi 2& > logfile &
2020-11-16 14:53:43 +00:00
Should be executed at least daily e.g. in crontab
python3 manage.py sendmails