Advertisement
Guest User

Untitled

a guest
Sep 12th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. import os
  2. import posixpath
  3. from os import environ
  4.  
  5. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  6. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  7.  
  8.  
  9.  
  10. # Quick-start development settings - unsuitable for production
  11. # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
  12.  
  13. # SECURITY WARNING: keep the secret key used in production secret!
  14. SECRET_KEY = 'A SECRET'
  15.  
  16. DEBUG = True
  17.  
  18. ALLOWED_HOSTS = ['*']
  19.  
  20.  
  21.  
  22.  
  23. SITE_TITLE = "Penguiness"
  24. SITE_TAGLINE = "Amazing records for amazing species"
  25.  
  26. # Application definition
  27.  
  28. INSTALLED_APPS = [
  29. 'app',
  30. # Add your apps here to enable them
  31. 'django.contrib.admin',
  32. 'django.contrib.auth',
  33. 'django.contrib.contenttypes',
  34. 'django.contrib.sessions',
  35. 'django.contrib.messages',
  36. 'django.contrib.staticfiles',
  37. 'compressor',
  38. 'gunicorn'
  39. ]
  40.  
  41. MIDDLEWARE_CLASSES = [
  42. 'django.middleware.security.SecurityMiddleware',
  43. 'django.contrib.sessions.middleware.SessionMiddleware',
  44. 'django.middleware.common.CommonMiddleware',
  45. 'django.middleware.csrf.CsrfViewMiddleware',
  46. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  47. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  48. 'django.contrib.messages.middleware.MessageMiddleware',
  49. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  50. 'whitenoise.middleware.WhiteNoiseMiddleware',
  51. ]
  52.  
  53. ROOT_URLCONF = 'Penguinness.urls'
  54.  
  55.  
  56. # Static files (CSS, JavaScript, Images)
  57. # https://docs.djangoproject.com/en/1.9/howto/static-files/
  58.  
  59.  
  60. STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  61.  
  62. STATIC_URL = '/static/'
  63.  
  64. STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['app/static']))
  65.  
  66. PROJECT_APP_PATH = os.path.dirname(os.path.abspath(__file__))
  67. PROJECT_APP = os.path.basename(PROJECT_APP_PATH)
  68. PROJECT_ROOT = BASE_DIR = os.path.dirname(PROJECT_APP_PATH)
  69.  
  70.  
  71. TEMPLATES = [
  72. {
  73. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  74. 'DIRS': [os.path.join(PROJECT_ROOT, "app/templates")],
  75. 'APP_DIRS': True,
  76. 'OPTIONS': {
  77. 'context_processors': [
  78. 'django.template.context_processors.debug',
  79. 'django.template.context_processors.request',
  80. 'django.contrib.auth.context_processors.auth',
  81. 'django.contrib.messages.context_processors.messages',
  82. 'app.context_processors.global_settings',
  83. ],
  84. },
  85. },
  86. ]
  87.  
  88. WSGI_APPLICATION = 'Penguinness.wsgi.application'
  89.  
  90.  
  91. # Database
  92. # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  93.  
  94. # DATABASES = {
  95. # 'default': {
  96. # DATABASE STUFF
  97. # }
  98. # }
  99.  
  100.  
  101.  
  102.  
  103.  
  104. SECURE_PROXY_SSL_HEADER = (
  105. "HTTP_X_FORWARDED_PROTO",
  106. "https"
  107. )
  108.  
  109.  
  110.  
  111.  
  112.  
  113. # Password validation
  114. # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
  115.  
  116. AUTH_PASSWORD_VALIDATORS = [
  117. {
  118. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  119. },
  120. {
  121. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  122. },
  123. {
  124. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  125. },
  126. {
  127. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  128. },
  129. ]
  130.  
  131.  
  132. # Internationalization
  133. # https://docs.djangoproject.com/en/1.9/topics/i18n/
  134.  
  135. LANGUAGE_CODE = 'en-us'
  136.  
  137. TIME_ZONE = 'UTC'
  138.  
  139. USE_I18N = True
  140.  
  141. USE_L10N = True
  142.  
  143. USE_TZ = True
  144.  
  145.  
  146. EMAIL_USE_TLS = True
  147. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  148. EMAIL_HOST = 'smtp.gmail.com'
  149. EMAIL_HOST_PASSWORD = PASSWORD #my gmail password
  150. EMAIL_HOST_USER = EMAIL #my gmail username
  151. EMAIL_PORT = 587
  152. DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
  153.  
  154.  
  155. import dj_database_url
  156. db_from_env = dj_database_url.config(conn_max_age=500)
  157. DATABASES['default'].update(db_from_env)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement