""" Django settings for project_base project. Generated by 'django-admin startproject' using Django 2.0.7. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.0/ref/settings/ """ import os from django.utils.translation import ugettext_lazy as _ try: from .settings_local import * except: pass # SECURITY WARNING: don't run with debug turned on in production! try: os.environ['django_DEBUG'] if os.environ['django_DEBUG'] == 'True': DEBUG = True else: DEBUG = False except KeyError: DEBUG = True # Build paths inside the project like this: os.path.join(BASE_DIR, ...) PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.0/howto/static-files/ #STATIC_URL = "https://cdn.awards.mediaarchitecture.org/site_media/static/" #MEDIA_URL = "https://cdn.awards.mediaarchitecture.org/site_media/media/" STATIC_ROOT = os.path.join(PROJECT_ROOT, "site_media", "static") MEDIA_ROOT = os.path.join(PROJECT_ROOT, "site_media", "media") try: os.environ['django_MEDIA_URL'] MEDIA_URL = os.environ['django_MEDIA_URL'] except: MEDIA_URL = '/site_media/media/' try: os.environ['django_STATIC_URL'] STATIC_URL = os.environ['django_STATIC_URL'] except: STATIC_URL = '/site_media/static/' try: os.environ['django_IMPORT_PATH'] IMPORT_PATH = os.environ['django_IMPORT_PATH'] except KeyError: IMPORT_PATH = '/' try: os.environ['django_OLD_IMPORT_PATH'] OLD_IMPORT_PATH = os.environ['django_OLD_IMPORT_PATH'] except KeyError: OLD_IMPORT_PATH = '/' try: os.environ['django_TEMP_PATH'] TEMP_PATH = os.environ['django_TEMP_PATH'] except KeyError: TEMP_PATH = '/' # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! try: os.environ['django_SECRET_KEY'] SECRET_KEY = os.environ['django_SECRET_KEY'] except KeyError: SECRET_KEY = 'KsN_QZ_fWqs18Z-3o}2~z0-@NA+/lP{YwVosC>6:Gxbu>ePUw=+Gv6lIZWR' try: os.environ['django_ALLOWED_HOSTS'] ENV_ALLOWED_HOSTS = os.environ['django_ALLOWED_HOSTS'] ALLOWED_HOSTS = [] ALLOWED_HOSTS.extend( ENV_ALLOWED_HOSTS.split() ) except KeyError: ALLOWED_HOSTS = ['*'] #if DEBUG == True: # ALLOWED_HOSTS = ['*'] #else: # ALLOWED_HOSTS = ['awards.mediaarchitecture.org', 'devawards.mediaarchitecture.org', 'devcatalog.mediaarchitecture.org' 'catalog.mediaarchitecture.org', 'localhost'] # Constance settings SPONSOR_CARDS = """ {% load static %}
image

""" ABOUT_TEXT = """ {% load static %}

Marktplatz

 

Unsere Sponsoren:
- -

Systementwickler
- -

Dies ist eine Website von

RealityLab

Gisela Legath-Gasse 5/1
1220 Wien - Österreich
www.realitylab.at
office@realitylab.at

Bitte beachten Sie unsere Datenschutzbestimmungen:
https://www.realitylab.at/privacy-policy/

""" MAIN_CARD = """ {% load static %}
image
Title

""" INFO_TXT = """

Bitte beachten Sie:

Füllen Sie so viele Felder wie möglich aus.
Pflichtfelder sind mit einem Sternchen gekennzeichnet*.

""" SUBMIT_TEXT = """


Wir möchten uns bei unseren Sponsoren bedanken:

Sponsoren

""" CONSTANCE_ADDITIONAL_FIELDS = { 'image_field': ['django.forms.ImageField', {}] } CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend' CONSTANCE_CONFIG = { 'ABOUT_CONTENT': (ABOUT_TEXT, 'Text for the about page'), 'SPONSOR_CARDS': (SPONSOR_CARDS, 'HTML for the sponsor cards'), 'MAIN_CARD': (MAIN_CARD, 'HTML for the main card'), 'CURRENT_EVENT': ('MAB20', 'Filter for the projects that should be evaluated'), 'INFO_TXT': (INFO_TXT, 'Text to help with the fill in the submitform'), 'SUBMIT_TEXT': (SUBMIT_TEXT, 'Text to welcome to the submitpage'), 'ADMIN_EMAIL': ('juan@mediaarchitecture.org', 'Admin email'), 'WEBSITE_TITEL': ('Markplatz', 'Name of the website'), 'LOGO_IMAGE': ('logo.png', 'Company logo', 'image_field'), 'EMAIL_NOREPLY' : ('no-reply@gemeinschaffen.com', 'No-reply email') } # Application definition INSTALLED_APPS = [ 'django.contrib.admin', # 'django.contrib.auth', 'project_base.apps.AuthConfigBase', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'marktplatz.apps.marktplatzConfig', #'constance', 'project_base.apps.ConstanceBase', 'constance.backends.database', 'imagekit', 'multiselectfield', 'crispy_forms', 'django_file_form', 'django_file_form.ajaxuploader', 'django_countries', 'captcha', 'debug_toolbar', 'project_base.apps.PostOfficeBase', 'project_base.apps.project_base', ] CRISPY_TEMPLATE_PACK = 'bootstrap4' CAPTCHA_NOISE_FUNCTIONS=('captcha.helpers.noise_dots',) CAPTCHA_LETTER_ROTATION=(-15,15) INTERNAL_IPS = [ # ... '127.0.0.1', # ... ] MIDDLEWARE = [ 'debug_toolbar.middleware.DebugToolbarMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] # 'htmlmin.middleware.HtmlMinifyMiddleware', # 'htmlmin.middleware.MarkRequestMiddleware', ROOT_URLCONF = 'project_base.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(PACKAGE_ROOT, "templates"),'./templates','./project_base', ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'constance.context_processors.config', 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'project_base.wsgi.application' #EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'post_office.EmailBackend' LOGIN_REDIRECT_URL = '/mab/home/' # Database # https://docs.djangoproject.com/en/2.0/ref/settings/#databases try: os.environ['django_DB_ENGINE'] DB_ENGINE = os.environ['django_DB_ENGINE'] except KeyError: DB_ENGINE = 'django.db.backends.sqlite3' try: os.environ['django_DB_NAME'] DB_NAME = os.environ['django_DB_NAME'] except KeyError: DB_NAME = os.path.join(BASE_DIR, 'db.sqlite3') try: os.environ['django_DB_USER'] DB_USER = os.environ['django_DB_USER'] except KeyError: DB_USER = '' try: os.environ['django_DB_PASSWORD'] DB_PASSWORD = os.environ['django_DB_PASSWORD'] except KeyError: DB_PASSWORD = '' try: os.environ['django_DB_HOST'] DB_HOST = os.environ['django_DB_HOST'] except KeyError: DB_HOST = '' try: os.environ['django_DB_PORT'] DB_PORT = os.environ['django_DB_PORT'] except KeyError: DB_PORT = '' if DB_ENGINE == "django.db.backends.mysql" : DB_OPTIONS = {'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"} else: DB_OPTIONS = {} DATABASES = { "default": { "ENGINE": DB_ENGINE, "NAME": DB_NAME, "USER": DB_USER, "PASSWORD": DB_PASSWORD, "HOST": DB_HOST, "PORT": DB_PORT, "OPTIONS" : DB_OPTIONS } } # Password validation # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/2.0/topics/i18n/ LANGUAGE_CODE = 'de-at' # 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. # On Unix systems, a value of None will cause Django to use the same # timezone as the operating system. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = "Europe/Vienna" USE_I18N = True USE_L10N = True USE_TZ = True #MAIL try: os.environ['django_DEFAULT_FROM_EMAIL'] DEFAULT_FROM_EMAIL = os.environ['django_DEFAULT_FROM_EMAIL'] except: DEFAULT_FROM_EMAIL = 'webmaster@localhost' try: os.environ['django_EMAIL_BACKEND'] EMAIL_BACKEND = os.environ['django_EMAIL_BACKEND'] except KeyError: EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" try: os.environ['django_EMAIL_HOST'] EMAIL_HOST = os.environ['django_EMAIL_HOST'] except KeyError: EMAIL_HOST = '' try: os.environ['django_EMAIL_HOST_USER'] EMAIL_HOST_USER = os.environ['django_EMAIL_HOST_USER'] except: EMAIL_HOST_USER = '' try: os.environ['django_EMAIL_HOST_PASSWORD'] EMAIL_HOST_PASSWORD = os.environ['django_EMAIL_HOST_PASSWORD'] except KeyError: EMAIL_HOST_PASSWORD = '' try: os.environ['django_EMAIL_PORT'] EMAIL_PORT = os.environ['django_EMAIL_PORT'] except KeyError: EMAIL_PORT = '' try: os.environ['django_EMAIL_USE_SSL'] if os.environ['django_EMAIL_USE_SSL'] == 'True' : EMAIL_USE_SSL = True else: EMAIL_USE_SSL = False except KeyError: EMAIL_USE_SSL = False