diff --git a/uwsgi-python/templates/apps/meckerkasten.j2 b/uwsgi-python/templates/apps/meckerkasten.j2 index 982f9f49f90bf821657e24b5e982498e0af6b52c..62af39ca8727871d337878d44ac561c295f4d22e 100644 --- a/uwsgi-python/templates/apps/meckerkasten.j2 +++ b/uwsgi-python/templates/apps/meckerkasten.j2 @@ -1,173 +1,10 @@ -# Django settings for meckerkasten project. +SESSION_COOKIE_SECURE = False -DEBUG = False +MAIL_SERVER = "{{meckerkasten_mail_host}}" +MAIL_DEFAULT_SENDER = "{{meckerkasten_sender}}" -ADMINS = ( - {% for name, address in meckerkasten_admins %} - ('{{ name }}', '{{ address }}'), +TOPICS = { + {% for question, mail in meckerkasten_topics.items() %} + "{{question}}": "{{mail}}", {% endfor %} -) -MANAGERS = ADMINS - -SERVER_EMAIL = "{{ meckerkasten_sender }}" -EMAIL_HOST = "{{ meckerkasten_mail_host }}" -EMAIL_HOST_USER = "{{ meckerkasten_mail_user|default('') }}" -EMAIL_HOST_PASSWORD = "{{ meckerkasten_mail_password|default('') }}" -EMAIL_PORT = {{ meckerkasten_mail_port|default('25') }} -DEFAUL_FROM_EMAIL = "{{ meckerkasten_sender }}" - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': '{{ app_db_name }}', - 'USER': '', - 'PASSWORD': '', - 'HOST': '', - 'PORT': '', - } -} - -# Hosts/domain names that are valid for this site; required if DEBUG is False -# See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts -ALLOWED_HOSTS = [ -{% for host in meckerkasten_allowed_hosts %} - "{{ host }}" -{% endfor %} -] - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# In a Windows environment this must be set to your system time zone. -TIME_ZONE = 'Europe/Berlin' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'de-DE' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# If you set this to False, Django will not format dates, numbers and -# calendars according to the current locale. -USE_L10N = True - -# If you set this to False, Django will not use timezone-aware datetimes. -USE_TZ = True - -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/home/media/media.lawrence.com/media/" -MEDIA_ROOT = '' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash. -# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" -MEDIA_URL = '' - -# Absolute path to the directory static files should be collected to. -# Don't put anything in this directory yourself; store your static files -# in apps' "static/" subdirectories and in STATICFILES_DIRS. -# Example: "/home/media/media.lawrence.com/static/" -STATIC_ROOT = '' - -# URL prefix for static files. -# Example: "http://media.lawrence.com/static/" -STATIC_URL = 'static/' - -# Additional locations of static files -STATICFILES_DIRS = ( - # Put strings here, like "/home/html/static" or "C:/www/django/static". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. -) - -# List of finder classes that know how to find static files in -# various locations. -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', -) - -# Make this unique, and don't share it with anybody. -import sys -sys.path.append('..') -from secret_config import secret_key as SECRET_KEY - -TEMPLATES = [ - { - "BACKEND": 'django.template.backends.django.DjangoTemplates', - "APP_DIRS": True, - "OPTIONS": { - "debug": DEBUG, - "context_processors": [ - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - ] - } - } -] - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - # Uncomment the next line for simple clickjacking protection: - # 'django.middleware.clickjacking.XFrameOptionsMiddleware', -) - -ROOT_URLCONF = 'meckerkasten.urls' - -# Python dotted path to the WSGI application used by Django's runserver. -WSGI_APPLICATION = 'main.wsgi.application' -TEMPLATE_CONTEXT_PROCESSORS = ( -) - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'frontend', - 'widget_tweaks', - # Uncomment the next line to enable the admin: - 'django.contrib.admin', - # Uncomment the next line to enable admin documentation: - # 'django.contrib.admindocs', -) - -# A sample logging configuration. The only tangible logging -# performed by this configuration is to send an email to -# the site admins on every HTTP 500 error when DEBUG=False. -# See http://docs.djangoproject.com/en/dev/topics/logging for -# more details on how to customize your logging configuration. -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' - } - }, - 'handlers': { - 'mail_admins': { - 'level': 'ERROR', - 'filters': ['require_debug_false'], - 'class': 'django.utils.log.AdminEmailHandler' - } - }, - 'loggers': { - 'django.request': { - 'handlers': ['mail_admins'], - 'level': 'ERROR', - 'propagate': True, - }, - } } diff --git a/uwsgi-python/vars/meckerkasten.yml b/uwsgi-python/vars/meckerkasten.yml index 99788f3cb14e79705ed83ea475346ed08cf729f7..614e47282d3e7b91eb4b4daafb77db2832149405 100644 --- a/uwsgi-python/vars/meckerkasten.yml +++ b/uwsgi-python/vars/meckerkasten.yml @@ -5,39 +5,32 @@ app_user: meckerkasten app_group: meckerkasten app_home: /var/www/meckerkasten app_path: /var/www/meckerkasten -app_python_version: 2 -app_venv: /var/www/meckerkasten -app_program: meckerkasten/wsgi.py -app_callable: application -app_command: "runserver" +app_python_version: 3 +app_venv: /var/www/meckerkasten/venv +app_program: meckerkasten.py +app_callable: app +app_command: "" app_mountpoint: / app_mules: 0 app_enable_threads: false app_uwsgi_options: [] -app_db_type: sqlite -app_db_name: "meckerkasten.sqlite3" - app_deploy_key: "{{ inventory_dir }}/files/deploy-keys/meckerkasten" app_git_url: "git@git.fsmpi.rwth-aachen.de:studi-systeme/meckerkasten.git" app_git_version: HEAD app_requirements_file: requirements.txt -app_config_file: meckerkasten/settings.py +app_config_file: config.py app_secret_config: true app_secret_config_keys: [] app_additional_software: [] -meckerkasten_admins: [['Admins', 'admin@example.com']] meckerkasten_sender: 'meckerkasten@example.com' meckerkasten_mail_host: 'mail.example.invalid' -meckerkasten_allowed_hosts: ['example.com'] meckerkasten_mail_user: '' meckerkasten_mail_password: '' meckerkasten_mail_port: '25' -app_service_env: - - MECKERKASTEN_WEB_ROOT=/var/www/meckerkasten/ - - MECKERKASTEN_WEB_SUBDIR=meckerkasten -# - LDAPTLS_CACERT= +meckerkasten_topics: + "Frage?": mail@example.com