You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.5 KiB

4 years ago
4 years ago
4 years ago
  1. # foerderbarometer
  2. purpose: gather data from intern(WMDE) and extern(volunteers) forms to create a database ('förderdatenbank') and send emails with links for a questionary.
  3. ## installation and development setup
  4. ln -sr foerderbarometer/settings_development.py foerderbarometer/settings.py
  5. build database with
  6. python3 manage.py migrate
  7. create superuser account with
  8. python3 manage.py createsuperuser
  9. run the development server with
  10. python3 manage.py runserver
  11. access via
  12. http://localhost/
  13. http://localhost/intern/ (login required)
  14. http://localhost/admin/ (login reqiured)
  15. ## versions used in development
  16. python 3.8.2
  17. django 3.1.1
  18. django-formtools 2.2
  19. whitenoise 5.2.0
  20. gunicorn 20.0.4
  21. ## testing
  22. run some tests with
  23. python3 manage.py test
  24. ## production setup
  25. ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py
  26. edit /secrets.json to contain something similar to
  27. {
  28. "DATABASE_PASSWORD": "THIS IS TOP SECRET!",
  29. "SECRET_KEY": "THIS IS ANOTHER SECRET!"
  30. }
  31. edit foerderbarometer/settings_production.py according to your database setup (tested with MariaDB 10.0.36)
  32. run the following commands:
  33. python3 manage.py makemigrations
  34. python3 manage.py migrate
  35. python3 manage.py collectstatic
  36. add to cron at least one time a day:
  37. python3 manage.py sendmails
  38. server starts with
  39. nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' foerderbarometer.wsgi 2&> logfile &
  40. Should be executed at least daily e.g. in crontab
  41. python3 manage.py sendmails