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.

91 lines
2.1 KiB

3 years ago
3 years ago
3 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. asgiref==3.2.10
  22. Django==3.1.2
  23. django-formtools==2.4
  24. gunicorn==20.0.4
  25. mysqlclient==2.1.1
  26. sqlparse==0.4.3
  27. whitenoise==6.2.0
  28. asgiref==3.2.10
  29. Authlib==1.2.1
  30. certifi==2023.7.22
  31. cffi==1.16.0
  32. chardet==5.2.0
  33. charset-normalizer==3.3.0
  34. cryptography==41.0.4
  35. idna==3.4
  36. pycparser==2.21
  37. pytz==2023.3.post1
  38. requests==2.31.0
  39. six==1.16.0
  40. typing_extensions==4.8.0
  41. urllib3==2.0.6
  42. ## testing
  43. run some tests with
  44. python3 manage.py test
  45. ## production setup
  46. ln -sr foerderbarometer/settings_production.py foerderbarometer/settings.py
  47. edit /secrets.json to contain something similar to
  48. {
  49. "DATABASE_PASSWORD": "THIS IS TOP SECRET!",
  50. "SECRET_KEY": "THIS IS ANOTHER SECRET!"
  51. }
  52. edit foerderbarometer/settings_production.py according to your database setup (tested with MariaDB 10.0.36)
  53. run the following commands:
  54. python3 manage.py migrate
  55. python3 manage.py collectstatic
  56. server starts with
  57. nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' foerderbarometer.wsgi 2&> logfile &
  58. Should be executed at least daily e.g. in crontab
  59. python3 manage.py sendmails