From 6cbfc034110b1e661e28943af777bdb164f29653 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 7 Apr 2021 13:56:45 +0200 Subject: [PATCH] added some adresses, settings and documentation --- README.md | 27 +++++++++++++++++++++++++++ TODO | 6 ++---- eva/settings_development.py | 3 ++- eva/settings_production.py | 1 + evapp/settings.py | 14 ++++++++++---- 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 777a8f0..e05d3e4 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,30 @@ environment managing tool - start your development server with python manage.py runserver + +# production + +- you can use gunicorn as server for example instead of the django development server. + +- we use whitenoise for serving static files + +- we still use the development SQLITE database from django + +do the following in the project main directory: + + ln -sr eva/settings_production.py eva/settings.py + +edit /secrets.json to contain something similar to + + { + "SECRET_KEY": "THIS IS ANOTHER SECRET!" + } + +run the following commands: + + python3 manage.py migrate + python3 manage.py collectstatic + +server starts with + + nohup gunicorn --forwarded-allow-ips="*" -b '0:8000' eva.wsgi 2&> logfile & diff --git a/TODO b/TODO index e256d5d..4a87dcd 100644 --- a/TODO +++ b/TODO @@ -2,8 +2,6 @@ known bugs: html problem in mails: 14" -> 14" -evapp/settings auf die richtigen adressen setzen +adresse fürs finanzteam fehlt noch - Accounts klären (OTRS und co. was genau muss in die liste) - -whitenoise/gunicorn in production +staticfiles wollen nicht in production diff --git a/eva/settings_development.py b/eva/settings_development.py index 10775f7..fd2ba07 100644 --- a/eva/settings_development.py +++ b/eva/settings_development.py @@ -25,7 +25,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' SECRET_KEY = 'g%+i6+gkwt3zz@+k-5x1dtstuw4)&qd$lxd^bt2oswy5e1#dul' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False # send mails only to debug mode adress even if in production MAILTEST = True @@ -51,6 +51,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', diff --git a/eva/settings_production.py b/eva/settings_production.py index 768460f..c81f04e 100644 --- a/eva/settings_production.py +++ b/eva/settings_production.py @@ -79,6 +79,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', diff --git a/evapp/settings.py b/evapp/settings.py index 4e40c25..d26a37e 100644 --- a/evapp/settings.py +++ b/evapp/settings.py @@ -10,7 +10,7 @@ BASIC_DATA = ['usermail', 'firstname', 'lastname', 'firstdate_employment', 'firs # for every department: 'MAIL' => mail adress, 'DATA': additional fields to include MAILS = { 'IT': { - 'MAIL': 'it@wikimedia.de', + 'MAIL': 'wmde-it@wikimedia.de', 'DATA': [ 'laptop', 'os', 'comment', 'email', 'landline', 'lists', 'mobile', 'department', 'accounts', 'language', 'screen', 'remote', 'desk', @@ -28,20 +28,26 @@ MAILS = { 'DATA': ['rebu2go',], }, 'KOMM': { - 'MAIL': 'kom@wikimedia.de', + 'MAIL': 'presse@wikimedia.de', 'DATA': [ 'department', 'team', 'jobdescription_german', 'jobdescription_english', ], }, + 'SPECIAL': { + 'MAIL': 'eileen.miedtank@wikimedia.de', + 'DATA': [ + 'department', 'team', 'language', 'sim', 'sim2', + ], + }, 'HR': { - 'MAIL': 'hr@wikimedia.de', + 'MAIL': 'personal@wikimedia.de, eileen.miedtank@wikimedia.de', 'DATA': [ 'department', 'team', 'language', ] }, 'DIRECTORAT': { - 'MAIL': 'vorstand@wikmedia.de', + 'MAIL': 'ricarda.busse@wikimedia.de', 'DATA': [ 'team', 'department', 'language', ]