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.

61 lines
1.4 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 makemigrations
  7. run the development server with
  8. python3 manage.py runserver
  9. ## versions used in development
  10. python 3.8.2
  11. django 3.1.1
  12. django-formtools 2.2
  13. whitenoise 5.2.0
  14. gunicorn 20.0.4
  15. ## testing
  16. run some tests with
  17. python3 manage.py test
  18. ## production setup
  19. ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py
  20. edit /secrets.json to contain something similar to
  21. {
  22. "DATABASE_PASSWORD": "THIS IS TOP SECRET!",
  23. "SECRET_KEY": "THIS IS ANOTHER SECRET!"
  24. }
  25. edit foerderbarometer/settings_production.py according to your database setup (tested with MariaDB 10.0.36)
  26. run the following commands:
  27. python3 manage.py makemigrations
  28. python3 manage.py migrate
  29. python3 manage.py collectstatic
  30. add to cron at least one time a day:
  31. python3 manage.py sendmails
  32. server starts with
  33. nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' foerderbarometer.wsgi 2&> logfile &
  34. Should be executed at least daily e.g. in crontab
  35. python3 manage.py sendmails