Advertisement
Guest User

Untitled

a guest
Apr 12th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. """
  2. Django settings for gettingstarted project, on Heroku. Fore more info, see:
  3. https://github.com/heroku/heroku-django-template
  4.  
  5. For more information on this file, see
  6. https://docs.djangoproject.com/en/1.8/topics/settings/
  7.  
  8. For the full list of settings and their values, see
  9. https://docs.djangoproject.com/en/1.8/ref/settings/
  10. """
  11.  
  12. import os
  13. import dj_database_url
  14.  
  15.  
  16. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  17. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  18. PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
  19.  
  20.  
  21. # Quick-start development settings - unsuitable for production
  22. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  23.  
  24. # SECURITY WARNING: change this before deploying to production!
  25. SECRET_KEY = 'i+acxn5(akgsn!fdffddml*f=s'
  26.  
  27. # SECURITY WARNING: don't run with debug turned on in production!
  28. DEBUG = True
  29.  
  30. ALLOWED_HOSTS = ['0.0.0.0' ,".herokuapp.com", 'www.thecolornet.com','thecolornet.com', 'newsletter-example.herokuapp.com' ,'localhost', '127.0.0.1']
  31.  
  32. EMAIL_HOST = 'smtp.gmail.com'
  33. EMAIL_HOST_USER = 'iasa.da42ver2@gmail.com'
  34. EMAIL_HOST_PASSWORD = 'unbreakable2014'
  35. EMAIL_PORT = 587
  36. EMAIL_USE_TLS = True
  37.  
  38. # Application definition
  39.  
  40. INSTALLED_APPS = (
  41. 'django.contrib.admin',
  42. 'django.contrib.sites',
  43. 'registration',
  44. 'django.contrib.auth',
  45. 'django.contrib.contenttypes',
  46. 'django.contrib.sessions',
  47. 'django.contrib.messages',
  48. 'django.contrib.staticfiles',
  49. # third party apps
  50. 'crispy_forms',
  51. # my apps
  52. 'newsletter',
  53. 'blog',
  54.  
  55. )
  56.  
  57. MIDDLEWARE_CLASSES = (
  58. 'django.contrib.sessions.middleware.SessionMiddleware',
  59. 'django.middleware.common.CommonMiddleware',
  60. 'django.middleware.csrf.CsrfViewMiddleware',
  61. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  62. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  63. 'django.contrib.messages.middleware.MessageMiddleware',
  64. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  65. 'django.middleware.security.SecurityMiddleware',
  66. )
  67.  
  68. ROOT_URLCONF = 'gettingstarted.urls'
  69.  
  70. TEMPLATES = [
  71. {
  72. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  73. 'DIRS': [os.path.join(BASE_DIR, "templates")],
  74. 'APP_DIRS': True,
  75. 'OPTIONS': {
  76. 'debug': True,
  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. ],
  83. },
  84. },
  85. ]
  86.  
  87. WSGI_APPLICATION = 'gettingstarted.wsgi.application'
  88.  
  89.  
  90. # Database
  91. # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  92.  
  93. DATABASES = {
  94. 'default': {
  95. 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  96. 'NAME': 'postgresql-animated-54254',
  97. 'USER': 'eikugyltepsvsi',
  98. 'PASSWORD': 'FlJGjNpPkEb-WeIFhCFJMtuUW2',
  99. 'HOST': 'ec2-23-21-157-223.compute-1.amazonaws.com',
  100. 'PORT': '5432',
  101. }
  102. }
  103.  
  104.  
  105.  
  106. # Password validation
  107. # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
  108.  
  109. AUTH_PASSWORD_VALIDATORS = [
  110. {
  111. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  112. },
  113. {
  114. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  115. },
  116. {
  117. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  118. },
  119. {
  120. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  121. },
  122. ]
  123.  
  124. # Internationalization
  125. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  126.  
  127. LANGUAGE_CODE = 'en-us'
  128. TIME_ZONE = 'UTC'
  129. USE_I18N = True
  130. USE_L10N = True
  131. USE_TZ = True
  132.  
  133.  
  134. # Update database configuration with $DATABASE_URL.
  135. db_from_env = dj_database_url.config(conn_max_age=500)
  136. DATABASES['default'].update(db_from_env)
  137.  
  138. # Honor the 'X-Forwarded-Proto' header for request.is_secure()
  139. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  140.  
  141.  
  142.  
  143.  
  144. # Static files (CSS, JavaScript, Images)
  145. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  146.  
  147. STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
  148. STATIC_URL = '/static/'
  149.  
  150. # Extra places for collectstatic to find static files.
  151. STATICFILES_DIRS = (
  152. os.path.join(PROJECT_ROOT, 'static'),
  153. )
  154.  
  155. # Simplified static file serving.
  156. # https://warehouse.python.org/project/whitenoise/
  157. STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
  158.  
  159.  
  160.  
  161. # django registration redux settings
  162. ACCOUNT_ACTIVATION_DAYS = 7
  163. REGISTRATION_AUTO_LOGIN = True
  164.  
  165. SITE_ID = 1
  166. LOGIN_REDIRECT_URL = '/'
  167.  
  168. # crispy forms tag settings
  169. CRISPY_TEMPLATE_PACK = "bootstrap3"
  170.  
  171. MEDIA_ROOT = os.path.join(BASE_DIR, "media")
  172. MEDIA_URL = "/media/"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement