|
10 | 10 | https://docs.djangoproject.com/en/3.2/ref/settings/ |
11 | 11 | """ |
12 | 12 | import os |
| 13 | +import sys |
13 | 14 | from pathlib import Path |
14 | 15 |
|
15 | 16 |
|
16 | 17 | # Build paths inside the project like this: BASE_DIR / 'subdir'. |
17 | 18 | BASE_DIR = Path(__file__).resolve().parent.parent |
18 | | - |
| 19 | +SRC_DIR = BASE_DIR.parent / "src" |
19 | 20 |
|
20 | 21 | # Quick-start development settings - unsuitable for production |
21 | 22 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ |
|
25 | 26 |
|
26 | 27 | # SECURITY WARNING: don't run with debug turned on in production! |
27 | 28 | DEBUG = True |
28 | | - |
29 | 29 | ALLOWED_HOSTS = [] |
30 | 30 |
|
31 | | - |
32 | 31 | # Application definition |
33 | | - |
34 | 32 | INSTALLED_APPS = [ |
35 | 33 | "django.contrib.admin", |
36 | 34 | "django.contrib.auth", |
|
41 | 39 | "channels", # Websocket library |
42 | 40 | "test_app", # This test application |
43 | 41 | ] |
44 | | - |
45 | 42 | MIDDLEWARE = [ |
46 | 43 | "django.middleware.security.SecurityMiddleware", |
47 | 44 | "django.contrib.sessions.middleware.SessionMiddleware", |
|
51 | 48 | "django.contrib.messages.middleware.MessageMiddleware", |
52 | 49 | "django.middleware.clickjacking.XFrameOptionsMiddleware", |
53 | 50 | ] |
54 | | - |
55 | 51 | ROOT_URLCONF = "test_app.urls" |
56 | | - |
57 | 52 | TEMPLATES = [ |
58 | 53 | { |
59 | 54 | "BACKEND": "django.template.backends.django.DjangoTemplates", |
|
69 | 64 | }, |
70 | 65 | }, |
71 | 66 | ] |
72 | | - |
73 | 67 | ASGI_APPLICATION = "test_app.asgi.application" |
74 | | - |
| 68 | +sys.path.append(str(SRC_DIR)) |
75 | 69 |
|
76 | 70 | # Database |
77 | 71 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases |
78 | | - |
79 | 72 | DATABASES = { |
80 | 73 | "default": { |
81 | 74 | "ENGINE": "django.db.backends.sqlite3", |
|
86 | 79 | }, |
87 | 80 | } |
88 | 81 |
|
89 | | - |
90 | 82 | # Password validation |
91 | 83 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators |
92 | | - |
93 | 84 | AUTH_PASSWORD_VALIDATORS = [ |
94 | 85 | { |
95 | 86 | "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", |
|
105 | 96 | }, |
106 | 97 | ] |
107 | 98 |
|
108 | | - |
109 | 99 | # Internationalization |
110 | 100 | # https://docs.djangoproject.com/en/3.2/topics/i18n/ |
111 | | - |
112 | 101 | LANGUAGE_CODE = "en-us" |
113 | | - |
114 | 102 | TIME_ZONE = "UTC" |
115 | | - |
116 | 103 | USE_I18N = True |
117 | | - |
118 | 104 | USE_L10N = True |
119 | | - |
120 | 105 | USE_TZ = True |
121 | 106 |
|
122 | 107 |
|
123 | | -# Static files (CSS, JavaScript, Images) |
124 | | -# https://docs.djangoproject.com/en/3.2/howto/static-files/ |
125 | | - |
126 | | -STATIC_URL = "/static/" |
127 | | - |
128 | 108 | # Default primary key field type |
129 | 109 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field |
130 | | - |
131 | 110 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
132 | | - |
133 | 111 | STATIC_ROOT = os.path.join(BASE_DIR, "static-deploy") |
134 | 112 |
|
135 | 113 | # Static Files (CSS, JavaScript, Images) |
| 114 | +# https://docs.djangoproject.com/en/3.2/howto/static-files/ |
| 115 | +STATIC_URL = "/static/" |
136 | 116 | STATICFILES_DIRS = [ |
137 | 117 | os.path.join(BASE_DIR, "test_app", "static"), |
138 | 118 | ] |
139 | | - |
140 | 119 | STATICFILES_FINDERS = [ |
141 | 120 | "django.contrib.staticfiles.finders.FileSystemFinder", |
142 | 121 | "django.contrib.staticfiles.finders.AppDirectoriesFinder", |
|
0 commit comments