Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Django settings for gettingstarted project, on Heroku. Fore more info, see:
- https://github.com/heroku/heroku-django-template
- For more information on this file, see
- https://docs.djangoproject.com/en/1.8/topics/settings/
- For the full list of settings and their values, see
- https://docs.djangoproject.com/en/1.8/ref/settings/
- """
- import os
- import dj_database_url
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(__file__))
- PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
- # Quick-start development settings - unsuitable for production
- # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
- # SECURITY WARNING: change this before deploying to production!
- SECRET_KEY = 'i+acxn5(akgsn!fdffddml*f=s'
- # SECURITY WARNING: don't run with debug turned on in production!
- DEBUG = True
- ALLOWED_HOSTS = ['0.0.0.0' ,".herokuapp.com", 'www.thecolornet.com','thecolornet.com', 'newsletter-example.herokuapp.com' ,'localhost', '127.0.0.1']
- EMAIL_HOST = 'smtp.gmail.com'
- EMAIL_HOST_USER = 'iasa.da42ver2@gmail.com'
- EMAIL_HOST_PASSWORD = 'unbreakable2014'
- EMAIL_PORT = 587
- EMAIL_USE_TLS = True
- # Application definition
- INSTALLED_APPS = (
- 'django.contrib.admin',
- 'django.contrib.sites',
- 'registration',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- # third party apps
- 'crispy_forms',
- # my apps
- 'newsletter',
- 'blog',
- )
- MIDDLEWARE_CLASSES = (
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'django.middleware.security.SecurityMiddleware',
- )
- ROOT_URLCONF = 'gettingstarted.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, "templates")],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'debug': True,
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- ],
- },
- },
- ]
- WSGI_APPLICATION = 'gettingstarted.wsgi.application'
- # Database
- # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': 'postgresql-animated-54254',
- 'USER': 'eikugyltepsvsi',
- 'PASSWORD': 'FlJGjNpPkEb-WeIFhCFJMtuUW2',
- 'HOST': 'ec2-23-21-157-223.compute-1.amazonaws.com',
- 'PORT': '5432',
- }
- }
- # Password validation
- # https://docs.djangoproject.com/en/1.9/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/1.8/topics/i18n/
- LANGUAGE_CODE = 'en-us'
- TIME_ZONE = 'UTC'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = True
- # Update database configuration with $DATABASE_URL.
- db_from_env = dj_database_url.config(conn_max_age=500)
- DATABASES['default'].update(db_from_env)
- # Honor the 'X-Forwarded-Proto' header for request.is_secure()
- SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/1.8/howto/static-files/
- STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
- STATIC_URL = '/static/'
- # Extra places for collectstatic to find static files.
- STATICFILES_DIRS = (
- os.path.join(PROJECT_ROOT, 'static'),
- )
- # Simplified static file serving.
- # https://warehouse.python.org/project/whitenoise/
- STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
- # django registration redux settings
- ACCOUNT_ACTIVATION_DAYS = 7
- REGISTRATION_AUTO_LOGIN = True
- SITE_ID = 1
- LOGIN_REDIRECT_URL = '/'
- # crispy forms tag settings
- CRISPY_TEMPLATE_PACK = "bootstrap3"
- MEDIA_ROOT = os.path.join(BASE_DIR, "media")
- MEDIA_URL = "/media/"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement