Schule als Staat Projekt Web, Dokumente, etc.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

130 строки
3.5KB

  1. """
  2. Django settings for sas_web project.
  3. Generated by 'django-admin startproject' using Django 1.8.7.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.8/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.8/ref/settings/
  8. """
  9. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  10. import os
  11. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  12. # Quick-start development settings - unsuitable for production
  13. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  14. # SECURITY WARNING: keep the secret key used in production secret!
  15. SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY',
  16. 'dnwe1fairy&@7=qoe7(w0bahnt9(&%zn8bph5&-r$1*s2$d2@h')
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. allowed = os.environ.get('DJANGO_ALLOWED_HOST', None)
  20. if allowed is not None:
  21. ALLOWED_HOSTS = allowed.split(",")
  22. else:
  23. ALLOWED_HOSTS = []
  24. # Define media paths e.g. for image storage
  25. MEDIA_URL = '/media/'
  26. MEDIA_ROOT = os.environ.get('DJANGO_MEDIA_ROOT',
  27. os.path.join((os.path.join(BASE_DIR, os.pardir)), "media"))
  28. # x forward
  29. USE_X_FORWARDED_HOST = True
  30. # Application definition
  31. INSTALLED_APPS = (
  32. 'captcha',
  33. 'datenbank',
  34. 'meingoethopia',
  35. 'startpage',
  36. 'django.contrib.admin',
  37. 'django.contrib.auth',
  38. 'django.contrib.contenttypes',
  39. 'django.contrib.sessions',
  40. 'django.contrib.messages',
  41. 'django.contrib.staticfiles',
  42. )
  43. MIDDLEWARE_CLASSES = (
  44. 'django.contrib.sessions.middleware.SessionMiddleware',
  45. 'django.middleware.common.CommonMiddleware',
  46. 'django.middleware.csrf.CsrfViewMiddleware',
  47. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  48. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  49. 'django.contrib.messages.middleware.MessageMiddleware',
  50. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  51. 'django.middleware.security.SecurityMiddleware',
  52. )
  53. ROOT_URLCONF = 'sas_web.urls'
  54. TEMPLATES = [
  55. {
  56. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  57. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  58. 'APP_DIRS': True,
  59. 'OPTIONS': {
  60. 'context_processors': [
  61. 'django.template.context_processors.debug',
  62. 'django.template.context_processors.request',
  63. 'django.contrib.auth.context_processors.auth',
  64. 'django.contrib.messages.context_processors.messages',
  65. 'sas_web.contexts.appname',
  66. ],
  67. },
  68. },
  69. ]
  70. WSGI_APPLICATION = 'sas_web.wsgi.application'
  71. # Database
  72. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  73. DATABASES = {
  74. 'default': {
  75. 'ENGINE': 'django.db.backends.mysql',
  76. 'NAME': os.environ.get('DJANGO_DATABASE_NAME', 'sas_db'),
  77. 'OPTIONS': {
  78. 'read_default_file': os.environ.get('DJANGO_DATABASE_CONFIG',
  79. os.path.join(BASE_DIR, 'my.cnf'))
  80. }
  81. }
  82. }
  83. # Internationalization
  84. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  85. LANGUAGE_CODE = 'de-de'
  86. TIME_ZONE = 'Europe/Berlin'
  87. USE_I18N = True
  88. USE_L10N = True
  89. USE_TZ = True
  90. # Static files (CSS, JavaScript, Images)
  91. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  92. STATIC_URL = '/static/'
  93. STATICFILES_DIRS = [
  94. os.path.join(BASE_DIR, "static")
  95. ]
  96. STATIC_ROOT = os.environ.get('DJANGO_STATIC_ROOT',
  97. os.path.join((os.path.join(BASE_DIR, os.pardir)), "static"))