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.

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