|
12 | 12 |
|
13 | 13 | import os
|
14 | 14 | from pathlib import Path
|
| 15 | +from typing import Iterable |
15 | 16 |
|
16 | 17 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
|
17 | 18 | BASE_DIR = Path(__file__).resolve().parent.parent
|
|
21 | 22 | # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
|
22 | 23 |
|
23 | 24 | # SECURITY WARNING: keep the secret key used in production secret!
|
24 |
| -SECRET_KEY = 'django-insecure-8c#%3-*$+ifulrb*$786w@xb$!vg2*db98%g2d+(kh!h-1su((' |
| 25 | +SECRET_KEY = ( |
| 26 | + "django-insecure-8c#%3-*$+ifulrb*$786w@xb$!vg2*db98%g2d+(kh!h-1su((" |
| 27 | +) |
25 | 28 |
|
26 | 29 | # SECURITY WARNING: don't run with debug turned on in production!
|
27 | 30 | DEBUG = True
|
28 | 31 |
|
29 |
| -ALLOWED_HOSTS = [] |
| 32 | +ALLOWED_HOSTS: Iterable[str] = [] |
30 | 33 |
|
31 | 34 |
|
32 | 35 | # Application definition
|
33 | 36 |
|
34 | 37 | INSTALLED_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', |
| 38 | + "django.contrib.admin", |
| 39 | + "django.contrib.auth", |
| 40 | + "django.contrib.contenttypes", |
| 41 | + "django.contrib.sessions", |
| 42 | + "django.contrib.messages", |
| 43 | + "django.contrib.staticfiles", |
41 | 44 | ]
|
42 | 45 |
|
43 | 46 | MIDDLEWARE = [
|
44 |
| - 'django.middleware.security.SecurityMiddleware', |
45 |
| - 'django.contrib.sessions.middleware.SessionMiddleware', |
46 |
| - 'django.middleware.common.CommonMiddleware', |
47 |
| - 'django.middleware.csrf.CsrfViewMiddleware', |
48 |
| - 'django.contrib.auth.middleware.AuthenticationMiddleware', |
49 |
| - 'django.contrib.messages.middleware.MessageMiddleware', |
50 |
| - 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 47 | + "django.middleware.security.SecurityMiddleware", |
| 48 | + "django.contrib.sessions.middleware.SessionMiddleware", |
| 49 | + "django.middleware.common.CommonMiddleware", |
| 50 | + "django.middleware.csrf.CsrfViewMiddleware", |
| 51 | + "django.contrib.auth.middleware.AuthenticationMiddleware", |
| 52 | + "django.contrib.messages.middleware.MessageMiddleware", |
| 53 | + "django.middleware.clickjacking.XFrameOptionsMiddleware", |
51 | 54 | ]
|
52 | 55 |
|
53 |
| -ROOT_URLCONF = 'src.octotest.urls' |
| 56 | +ROOT_URLCONF = "src.octotest.urls" |
54 | 57 |
|
55 | 58 | TEMPLATES = [
|
56 | 59 | {
|
57 |
| - 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
58 |
| - 'DIRS': [], |
59 |
| - 'APP_DIRS': True, |
60 |
| - 'OPTIONS': { |
61 |
| - 'context_processors': [ |
62 |
| - 'django.template.context_processors.debug', |
63 |
| - 'django.template.context_processors.request', |
64 |
| - 'django.contrib.auth.context_processors.auth', |
65 |
| - 'django.contrib.messages.context_processors.messages', |
| 60 | + "BACKEND": "django.template.backends.django.DjangoTemplates", |
| 61 | + "DIRS": [], |
| 62 | + "APP_DIRS": True, |
| 63 | + "OPTIONS": { |
| 64 | + "context_processors": [ |
| 65 | + "django.template.context_processors.debug", |
| 66 | + "django.template.context_processors.request", |
| 67 | + "django.contrib.auth.context_processors.auth", |
| 68 | + "django.contrib.messages.context_processors.messages", |
66 | 69 | ],
|
67 | 70 | },
|
68 | 71 | },
|
69 | 72 | ]
|
70 | 73 |
|
71 |
| -WSGI_APPLICATION = 'src.octotest.wsgi.application' |
| 74 | +WSGI_APPLICATION = "src.octotest.wsgi.application" |
72 | 75 |
|
73 | 76 |
|
74 | 77 | # Database
|
75 | 78 | # https://docs.djangoproject.com/en/5.1/ref/settings/#databases
|
76 | 79 |
|
77 | 80 | DATABASES = {
|
78 |
| - 'default': { |
79 |
| - 'ENGINE': 'django.db.backends.postgresql', |
80 |
| - 'NAME': os.environ.get('POSTGRES_NAME'), |
81 |
| - 'USER': os.environ.get('POSTGRES_USER'), |
82 |
| - 'PASSWORD': os.environ.get('POSTGRES_PASSWORD'), |
83 |
| - 'HOST': 'db', |
84 |
| - 'PORT': 5432, |
| 81 | + "default": { |
| 82 | + "ENGINE": "django.db.backends.postgresql", |
| 83 | + "NAME": os.environ.get("POSTGRES_NAME"), |
| 84 | + "USER": os.environ.get("POSTGRES_USER"), |
| 85 | + "PASSWORD": os.environ.get("POSTGRES_PASSWORD"), |
| 86 | + "HOST": "db", |
| 87 | + "PORT": 5432, |
85 | 88 | }
|
86 | 89 | }
|
87 | 90 |
|
|
91 | 94 |
|
92 | 95 | AUTH_PASSWORD_VALIDATORS = [
|
93 | 96 | {
|
94 |
| - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 97 | + "NAME": ( |
| 98 | + "django.contrib.auth.password_validation." |
| 99 | + "UserAttributeSimilarityValidator" |
| 100 | + ), |
95 | 101 | },
|
96 | 102 | {
|
97 |
| - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 103 | + "NAME": ( |
| 104 | + "django.contrib.auth.password_validation." "MinimumLengthValidator" |
| 105 | + ), |
98 | 106 | },
|
99 | 107 | {
|
100 |
| - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 108 | + "NAME": ( |
| 109 | + "django.contrib.auth.password_validation." |
| 110 | + "CommonPasswordValidator" |
| 111 | + ), |
101 | 112 | },
|
102 | 113 | {
|
103 |
| - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 114 | + "NAME": ( |
| 115 | + "django.contrib.auth.password_validation." |
| 116 | + "NumericPasswordValidator" |
| 117 | + ), |
104 | 118 | },
|
105 | 119 | ]
|
106 | 120 |
|
107 | 121 |
|
108 | 122 | # Internationalization
|
109 | 123 | # https://docs.djangoproject.com/en/5.1/topics/i18n/
|
110 | 124 |
|
111 |
| -LANGUAGE_CODE = 'en-us' |
| 125 | +LANGUAGE_CODE = "en-us" |
112 | 126 |
|
113 |
| -TIME_ZONE = 'UTC' |
| 127 | +TIME_ZONE = "UTC" |
114 | 128 |
|
115 | 129 | USE_I18N = True
|
116 | 130 |
|
|
120 | 134 | # Static files (CSS, JavaScript, Images)
|
121 | 135 | # https://docs.djangoproject.com/en/5.1/howto/static-files/
|
122 | 136 |
|
123 |
| -STATIC_URL = 'static/' |
| 137 | +STATIC_URL = "static/" |
124 | 138 |
|
125 | 139 | # Default primary key field type
|
126 | 140 | # https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
|
127 | 141 |
|
128 |
| -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' |
| 142 | +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
0 commit comments