1"""
2Django settings for test_project project.
3
4Generated by "django-admin startproject" using Django 1.10a1.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/dev/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/dev/ref/settings/
11"""
12
13import os
14import getpass
15
16# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
18
19
20# Quick-start development settings - unsuitable for production
21# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
22
23# SECURITY WARNING: keep the secret key used in production secret!
24SECRET_KEY = "lzu78x^s$rit0p*vdt)$1e&hh*)4y=xv))=@zsx(am7t=7406a"
25
26# SECURITY WARNING: don"t run with debug turned on in production!
27DEBUG = True
28
29ALLOWED_HOSTS = []
30
31
32# Application definition
33
34INSTALLED_APPS = [
35    "django.contrib.admin",
36    "django.contrib.auth",
37    "django.contrib.contenttypes",
38    "django.contrib.sessions",
39    "django.contrib.messages",
40    "django.contrib.staticfiles",
41    "reversion",
42    "test_app",
43]
44
45MIDDLEWARE = [
46    "django.middleware.security.SecurityMiddleware",
47    "django.contrib.sessions.middleware.SessionMiddleware",
48    "django.middleware.common.CommonMiddleware",
49    "django.middleware.csrf.CsrfViewMiddleware",
50    "django.contrib.auth.middleware.AuthenticationMiddleware",
51    "django.contrib.messages.middleware.MessageMiddleware",
52    "django.middleware.clickjacking.XFrameOptionsMiddleware",
53]
54
55ROOT_URLCONF = "test_project.urls"
56
57TEMPLATES = [
58    {
59        "BACKEND": "django.template.backends.django.DjangoTemplates",
60        "DIRS": [],
61        "APP_DIRS": True,
62        "OPTIONS": {
63            "context_processors": [
64                "django.template.context_processors.debug",
65                "django.template.context_processors.request",
66                "django.contrib.auth.context_processors.auth",
67                "django.contrib.messages.context_processors.messages",
68            ],
69        },
70    },
71]
72
73WSGI_APPLICATION = "test_project.wsgi.application"
74
75
76# Database
77# https://docs.djangoproject.com/en/dev/ref/settings/#databases
78
79DATABASES = {
80    "default": {
81        "ENGINE": "django.db.backends.sqlite3",
82        "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
83    },
84    "postgres": {
85        "ENGINE": "django.db.backends.postgresql_psycopg2",
86        "NAME": os.environ.get("DJANGO_DATABASE_NAME_POSTGRES", "test_project"),
87        "USER": os.environ.get("DJANGO_DATABASE_USER_POSTGRES", getpass.getuser()),
88        "PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD_POSTGRES", ""),
89    },
90    "mysql": {
91        "ENGINE": "django.db.backends.mysql",
92        "NAME": os.environ.get("DJANGO_DATABASE_NAME_MYSQL", "test_project"),
93        "USER": os.environ.get("DJANGO_DATABASE_USER_MYSQL", getpass.getuser()),
94        "PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD_MYSQL", ""),
95    },
96}
97
98
99# Password validation
100# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators
101
102AUTH_PASSWORD_VALIDATORS = [
103    {
104        "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
105    },
106    {
107        "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
108    },
109    {
110        "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
111    },
112    {
113        "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
114    },
115]
116
117
118# Internationalization
119# https://docs.djangoproject.com/en/dev/topics/i18n/
120
121LANGUAGE_CODE = "en-us"
122
123TIME_ZONE = "UTC"
124
125USE_I18N = True
126
127USE_L10N = True
128
129USE_TZ = True
130
131
132# Static files (CSS, JavaScript, Images)
133# https://docs.djangoproject.com/en/dev/howto/static-files/
134
135STATIC_URL = "/static/"
136