Go to file
Oliver Zander 0afabe9325 fixed read only fields of travel admin 2025-10-23 11:27:38 +00:00
foerderbarometer merged settings & use .env files to configure differences 2025-10-23 11:27:38 +00:00
input fixed read only fields of travel admin 2025-10-23 11:27:38 +00:00
.env.develop.example merged settings & use .env files to configure differences 2025-10-23 11:27:38 +00:00
.env.production.example merged settings & use .env files to configure differences 2025-10-23 11:27:38 +00:00
.gitignore merged settings & use .env files to configure differences 2025-10-23 11:27:38 +00:00
LICENSE added mail_state to all objects, added filters regarding sendmail.py 2022-11-30 00:09:10 +00:00
README.md merged settings & use .env files to configure differences 2025-10-23 11:27:38 +00:00
TODO added mail_state to all objects, added filters regarding sendmail.py 2022-11-30 00:09:10 +00:00
manage.py new django project 2020-09-21 14:27:16 +02:00
requirements.txt merged settings & use .env files to configure differences 2025-10-23 11:27:38 +00: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

cp .env.develop.example .env

To use a MariaDB change DATABASE_ENGINE in .env to mysql and amend DATABASE_* variables according to your setup. For further information see the production setup below.

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

asgiref==3.2.10
Django==3.1.2
django-formtools==2.4
gunicorn==20.0.4
mysqlclient==2.1.1
sqlparse==0.4.3
whitenoise==6.2.0
asgiref==3.2.10
Authlib==1.2.1
certifi==2023.7.22
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.0
cryptography==41.0.4
idna==3.4
pycparser==2.21
pytz==2023.3.post1
requests==2.31.0
six==1.16.0
typing_extensions==4.8.0
urllib3==2.0.6

testing

run some tests with

python3 manage.py test

production setup

cp .env.production.example .env

edit .env and fill in the missing secrets

SECRET_KEY
DATABASE_PASSWORD
EMAIL_HOST_USER
EMAIL_HOST_PASSWORD
OAUTH_CLIENT_NAME
OAUTH_CLIENT_ID
OAUTH_CLIENT_SECRET

amend database variables to .env according to your database setup (tested with MariaDB 10.0.36), e.g.

DATABASE_NAME
DATABASE_USER
DATABASE_HOST
DATABASE_PORT

for a full set of all possible env vars have a look at foerderbarometer/settings.py

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