Debian Codegraph @

test_project/settings.py

raw symbols SCIP
1 # Django settings for testsite project.
2 import os
3
4 PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
5
6 DEBUG = True
7
8 DB_ENGINE = os.environ.get("DB_ENGINE", "postgresql")
9
10 DATABASES = {
11 "default": {
12 "ENGINE": f"django.db.backends.{DB_ENGINE}",
13 "NAME": os.environ.get("DB_NAME", "postgres"),
14 "USER": os.environ.get("DB_USER", 'postgres'),
15 "PASSWORD": os.environ.get("DB_PASSWORD", "postgres"),
16 "HOST": os.environ.get("DB_HOST", "127.0.0.1"),
17 "PORT": os.environ.get("DB_PORT", 5432)
18 },
19 }
20
21 # Local time zone for this installation. Choices can be found here:
22 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
23 # although not all choices may be available on all operating systems.
24 # If running in a Windows environment this must be set to the same as your
25 # system time zone.
26 TIME_ZONE = 'America/Chicago'
27
28 # Language code for this installation. All choices can be found here:
29 # http://www.i18nguy.com/unicode/language-identifiers.html
30 LANGUAGE_CODE = 'en-us'
31
32 SITE_ID = 1
33
34 # If you set this to False, Django will make some optimizations so as not
35 # to load the internationalization machinery.
36 USE_I18N = True
37
38 # Absolute path to the directory that holds media.
39 # Example: "/home/media/media.lawrence.com/"
40 MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
41 STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
42
43 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
44 # trailing slash if there is a path component (optional in other cases).
45 # Examples: "http://media.lawrence.com", "http://example.com/media/"
46 MEDIA_URL = '/media/'
47 STATIC_URL = '/static/'
48
49 # Make this unique, and don't share it with anybody.
50 SECRET_KEY = 'define in local settings file'
51
52 MIDDLEWARE = [
53 'django.middleware.security.SecurityMiddleware',
54 'django.contrib.sessions.middleware.SessionMiddleware',
55 'django.middleware.common.CommonMiddleware',
56 'django.middleware.csrf.CsrfViewMiddleware',
57 'django.contrib.auth.middleware.AuthenticationMiddleware',
58 'django.contrib.messages.middleware.MessageMiddleware',
59 'django.middleware.clickjacking.XFrameOptionsMiddleware',
60 ]
61
62 ROOT_URLCONF = 'example.urls'
63
64 INSTALLED_APPS = (
65 'django.contrib.auth',
66 'django.contrib.contenttypes',
67 'django.contrib.sessions',
68 'django.contrib.messages',
69 'django.contrib.admin',
70 'django.contrib.staticfiles',
71
72 'sortedm2m',
73 'sortedm2m_tests',
74 'sortedm2m_tests.migrations_tests',
75 'sortedm2m_tests.altersortedmanytomanyfield_tests',
76
77 'example.testapp',
78 )
79
80 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
81
82 TEMPLATES = [
83 {
84 'BACKEND': 'django.template.backends.django.DjangoTemplates',
85 'DIRS': [
86 os.path.join(PROJECT_ROOT, 'templates'),
87 ],
88 'APP_DIRS': True,
89 'OPTIONS': {
90 'context_processors': [
91 'django.contrib.auth.context_processors.auth',
92 'django.template.context_processors.debug',
93 'django.template.context_processors.i18n',
94 'django.template.context_processors.media',
95 'django.template.context_processors.static',
96 'django.template.context_processors.tz',
97 'django.template.context_processors.request',
98 'django.contrib.messages.context_processors.messages',
99 ],
100 },
101 },
102 ]
103
104 # Default primary key field type
105 # https://docs.djangoproject.com/en/dev/ref/settings/#default-auto-field
106 DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
107