1
0
Fork 0
Go to file
corsaronero 4c016a4a5a added dropdown agreement to send my data for buying literature for me 2022-11-11 11:54:26 +00:00
foerderbarometer new settings file maria db dev 2021-11-04 18:19:27 +01:00
input added dropdown agreement to send my data for buying literature for me 2022-11-11 11:54:26 +00:00
.gitignore new mail adress, new migrations, changes in .gitignore for production 2020-12-17 12:23:52 +00:00
LICENSE Initial commit 2020-09-21 11:31:02 +00:00
README.md docu changes only 2021-06-21 18:05:10 +02:00
TODO fixture added to fix deployment problem with key constraints 2021-11-03 13:43:40 +01:00
manage.py new django project 2020-09-21 14:27:16 +02:00

README.md

foerderbarometer

purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a database ('förderdatenbank') and send emails with links for a questionary.

installation and development setup

ln -sr foerderbarometer/settings_development.py foerderbarometer/settings.py

build the database with

python3 manage.py migrate

create superuser account with

python3 manage.py createsuperuser

run the development server with

python3 manage.py runserver

access via

http://localhost:8000/
http://localhost:8000/intern/    (login required)
http://localhost:8000/admin/     (login reqiured)

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"

versions used in development

python 3.8.2
django 3.1.x (does not work with django 3.2 in the moment!)
django-formtools 2.2
whitenoise 5.2.0
gunicorn 20.0.4

testing

run some tests with

python3 manage.py test

production setup

ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py

edit /secrets.json to contain something similar to

{
  "DATABASE_PASSWORD": "THIS IS TOP SECRET!",
  "SECRET_KEY": "THIS IS ANOTHER SECRET!"
}

edit foerderbarometer/settings_production.py according to your database setup (tested with MariaDB 10.0.36)

run the following commands:

python3 manage.py migrate
python3 manage.py collectstatic

server starts with

nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' foerderbarometer.wsgi 2&> logfile &

Should be executed at least daily e.g. in crontab

python3 manage.py sendmails