Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import posixpath
- from os import environ
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- # Quick-start development settings - unsuitable for production
- # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
- # SECURITY WARNING: keep the secret key used in production secret!
- SECRET_KEY = 'A SECRET'
- DEBUG = True
- ALLOWED_HOSTS = ['*']
- SITE_TITLE = "Penguiness"
- SITE_TAGLINE = "Amazing records for amazing species"
- # Application definition
- INSTALLED_APPS = [
- 'app',
- # Add your apps here to enable them
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'compressor',
- 'gunicorn'
- ]
- MIDDLEWARE_CLASSES = [
- 'django.middleware.security.SecurityMiddleware',
- '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',
- 'whitenoise.middleware.WhiteNoiseMiddleware',
- ]
- ROOT_URLCONF = 'Penguinness.urls'
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/1.9/howto/static-files/
- STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
- STATIC_URL = '/static/'
- STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['app/static']))
- PROJECT_APP_PATH = os.path.dirname(os.path.abspath(__file__))
- PROJECT_APP = os.path.basename(PROJECT_APP_PATH)
- PROJECT_ROOT = BASE_DIR = os.path.dirname(PROJECT_APP_PATH)
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(PROJECT_ROOT, "app/templates")],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- 'app.context_processors.global_settings',
- ],
- },
- },
- ]
- WSGI_APPLICATION = 'Penguinness.wsgi.application'
- # Database
- # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
- # DATABASES = {
- # 'default': {
- # DATABASE STUFF
- # }
- # }
- SECURE_PROXY_SSL_HEADER = (
- "HTTP_X_FORWARDED_PROTO",
- "https"
- )
- # 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.9/topics/i18n/
- LANGUAGE_CODE = 'en-us'
- TIME_ZONE = 'UTC'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = True
- EMAIL_USE_TLS = True
- EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
- EMAIL_HOST = 'smtp.gmail.com'
- EMAIL_HOST_PASSWORD = PASSWORD #my gmail password
- EMAIL_HOST_USER = EMAIL #my gmail username
- EMAIL_PORT = 587
- DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
- import dj_database_url
- db_from_env = dj_database_url.config(conn_max_age=500)
- DATABASES['default'].update(db_from_env)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement