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.

84 lines
1.9 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 the 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. you can run some very basic tests with
  12. python3 manage.py test
  13. access via
  14. http://localhost/
  15. http://localhost/intern/ (login required)
  16. http://localhost/admin/ (login reqiured)
  17. ## additional admin functionality
  18. The admin page is the standard admin page delivered by django but with two additional functionalities:
  19. - There is a new action "export to csv" with which you can export all Selected
  20. entries to a csv file
  21. - There is a new button in the bottom of every Project to "save as new"
  22. ## versions used in development
  23. python 3.8.2
  24. django 3.1.1
  25. django-formtools 2.2
  26. whitenoise 5.2.0
  27. gunicorn 20.0.4
  28. ## testing
  29. run some tests with
  30. python3 manage.py test
  31. ## production setup
  32. ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py
  33. edit /secrets.json to contain something similar to
  34. {
  35. "DATABASE_PASSWORD": "THIS IS TOP SECRET!",
  36. "SECRET_KEY": "THIS IS ANOTHER SECRET!"
  37. }
  38. edit foerderbarometer/settings_production.py according to your database setup (tested with MariaDB 10.0.36)
  39. run the following commands:
  40. python3 manage.py makemigrations
  41. python3 manage.py migrate
  42. python3 manage.py collectstatic
  43. add to cron at least one time a day:
  44. python3 manage.py sendmails
  45. server starts with
  46. nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' foerderbarometer.wsgi 2&> logfile &
  47. Should be executed at least daily e.g. in crontab
  48. python3 manage.py sendmails