strange bugs, wrong ideas, not sure what this was all about?!?

Benni Bärmann 3 years ago
parent 0df4cc9b93
commit 06a3d727ca

@ -2,9 +2,13 @@
purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a database ('förderdatenbank') and send emails with links for a questionary.
## Should be executed daily
## installation and development setup
python3 sendmails
ln -sr foerderbarometer/ foerderbarometer/
run the development server with
python3 runserver
## versions used in development
@ -16,7 +20,7 @@ purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a
## production setup
ln -s foerderbarometer/ foerderbarometer/
ln -sr foerderbarometer/ foerderbarometer/
edit /secrets.json to contain something similar to
@ -28,14 +32,19 @@ edit foerderbarometer/ according to your database setup (t
run the following commands:
python makemigrations
python migrate
python collectstatic
python3 makemigrations
python3 migrate
python3 collectstatic
add to cron at least one time a day:
python sendmails
python3 sendmails
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 sendmails

@ -1,4 +1,5 @@
from datetime import date
from smtplib import SMTPException
from django.shortcuts import render
from django.forms import modelformset_factory
@ -154,19 +155,19 @@ class ExternView(CookieWizardView):
# write data to database
form =
modell =
# we have to copy the data from the first form here
# this is a bit ugly code. how can we copy this without explicit writing?
form.realname = data['realname']
# this is a bit ugly code. can we copy this without explicit writing?
modell.realname = data['realname']
# form.username = data['username'] = data['email'] = data['email']
# write type of form in some cases
if data['choice'] in ('BIB', 'ELIT', 'SOFT'):
form.type = data['choice']
modell.type = data['choice']
# add some data to context for mail templates
data['pk'] =
data['pk'] =
data['urlprefix'] = settings.URLPREFIX
data['grant'] = ('LIT', 'SOFT', 'ELIT', 'BIB', 'IFG')
data['DOMAIN'] = ('MAIL', 'LIST')
@ -181,7 +182,7 @@ class ExternView(CookieWizardView):
'Formular ausgefüllt',
# - mail to IF with link to accept/decline
mail_template = get_template('input/if_mail.txt')
@ -193,6 +194,9 @@ class ExternView(CookieWizardView):
except BadHeaderError:
return HttpResponse('Invalid header found.')
return HttpResponse('Invalid header found. Data not saved!')
except SMTPException:
return HttpResponse('Error in sending mails (propably wrong adress?). Data not saved!')
return done(self.request)