|
| 1 | +""" |
| 2 | +Django settings for dj_psxl_exp project. |
| 3 | +
|
| 4 | +Generated by 'django-admin startproject' using Django 2.1.4. |
| 5 | +
|
| 6 | +For more information on this file, see |
| 7 | +https://docs.djangoproject.com/en/2.1/topics/settings/ |
| 8 | +
|
| 9 | +For the full list of settings and their values, see |
| 10 | +https://docs.djangoproject.com/en/2.1/ref/settings/ |
| 11 | +""" |
| 12 | + |
| 13 | +import os |
| 14 | + |
| 15 | +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
| 16 | +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 17 | + |
| 18 | +# Quick-start development settings - unsuitable for production |
| 19 | +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ |
| 20 | + |
| 21 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 22 | +SECRET_KEY = 'qeprnfr&h63t9$gxqd+8vz&fu8p#tlq71o&!t$2y2g703_rc@r' |
| 23 | + |
| 24 | +# SECURITY WARNING: don't run with debug turned on in production! |
| 25 | +DEBUG = True |
| 26 | + |
| 27 | +ALLOWED_HOSTS = [] |
| 28 | + |
| 29 | +# Application definition |
| 30 | + |
| 31 | +INSTALLED_APPS = [ |
| 32 | + 'django.contrib.admin', |
| 33 | + 'django.contrib.auth', |
| 34 | + 'django.contrib.contenttypes', |
| 35 | + 'django.contrib.sessions', |
| 36 | + 'django.contrib.messages', |
| 37 | + 'django.contrib.staticfiles', |
| 38 | + 'ads', |
| 39 | +] |
| 40 | + |
| 41 | +MIDDLEWARE = [ |
| 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.messages.middleware.MessageMiddleware', |
| 48 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 49 | +] |
| 50 | + |
| 51 | +ROOT_URLCONF = 'dj_psxl_exp.urls' |
| 52 | + |
| 53 | +TEMPLATES = [ |
| 54 | + { |
| 55 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 56 | + 'DIRS': [], |
| 57 | + 'APP_DIRS': True, |
| 58 | + 'OPTIONS': { |
| 59 | + 'context_processors': [ |
| 60 | + 'django.template.context_processors.debug', |
| 61 | + 'django.template.context_processors.request', |
| 62 | + 'django.contrib.auth.context_processors.auth', |
| 63 | + 'django.contrib.messages.context_processors.messages', |
| 64 | + ], |
| 65 | + }, |
| 66 | + }, |
| 67 | +] |
| 68 | + |
| 69 | +WSGI_APPLICATION = 'dj_psxl_exp.wsgi.application' |
| 70 | + |
| 71 | +# Database |
| 72 | +# https://docs.djangoproject.com/en/2.1/ref/settings/#databases |
| 73 | + |
| 74 | +DATABASES = { |
| 75 | + 'default': { |
| 76 | + 'ENGINE': 'django.db.backends.postgresql_psycopg2', |
| 77 | + 'HOST': os.environ.get('DATABASES_HOST', '192.168.0.142'), |
| 78 | + 'PORT': os.environ.get('DATABASES_PORT', 30002), |
| 79 | + 'NAME': os.environ.get('DATABASES_NAME', 'test'), |
| 80 | + 'USER': os.environ.get('DATABASES_USER', 'postgres'), |
| 81 | + 'PASSWORD': os.environ.get('DATABASES_PASSWORD', 'postgres'), |
| 82 | + 'DISABLE_SERVER_SIDE_CURSORS': True, |
| 83 | + } |
| 84 | +} |
| 85 | + |
| 86 | +# Password validation |
| 87 | +# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators |
| 88 | + |
| 89 | +AUTH_PASSWORD_VALIDATORS = [ |
| 90 | + { |
| 91 | + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 92 | + }, |
| 93 | + { |
| 94 | + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 95 | + }, |
| 96 | + { |
| 97 | + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 98 | + }, |
| 99 | + { |
| 100 | + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 101 | + }, |
| 102 | +] |
| 103 | + |
| 104 | +# Internationalization |
| 105 | +# https://docs.djangoproject.com/en/2.1/topics/i18n/ |
| 106 | + |
| 107 | +LANGUAGE_CODE = 'en-us' |
| 108 | + |
| 109 | +TIME_ZONE = 'UTC' |
| 110 | + |
| 111 | +USE_I18N = True |
| 112 | + |
| 113 | +USE_L10N = True |
| 114 | + |
| 115 | +USE_TZ = True |
| 116 | + |
| 117 | +# Static files (CSS, JavaScript, Images) |
| 118 | +# https://docs.djangoproject.com/en/2.1/howto/static-files/ |
| 119 | + |
| 120 | +STATIC_URL = '/static/' |
| 121 | + |
| 122 | + |
| 123 | +# @note: Patch to define default creation tables as replication |
| 124 | +from django.db.backends.base.schema import BaseDatabaseSchemaEditor |
| 125 | +BaseDatabaseSchemaEditor.sql_create_table = "CREATE TABLE %(table)s (%(definition)s) DISTRIBUTE BY REPLICATION" |
0 commit comments