|
1 | 1 | """ |
2 | 2 | Django settings for hello_world project. |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 4.2.11. |
| 4 | +Generated by 'django-admin startproject' using Django 5.0.4. |
5 | 5 |
|
6 | 6 | For more information on this file, see |
7 | | -https://docs.djangoproject.com/en/4.2/topics/settings/ |
| 7 | +https://docs.djangoproject.com/en/5.0/topics/settings/ |
8 | 8 |
|
9 | 9 | For the full list of settings and their values, see |
10 | | -https://docs.djangoproject.com/en/4.2/ref/settings/ |
| 10 | +https://docs.djangoproject.com/en/5.0/topics/settings/ |
11 | 11 | """ |
12 | 12 |
|
13 | 13 | import os |
14 | 14 | from pathlib import Path |
15 | | -from dotenv import load_dotenv |
16 | | - |
17 | | -load_dotenv() |
| 15 | +from decouple import config |
18 | 16 |
|
19 | 17 | # Build paths inside the project like this: BASE_DIR / 'subdir'. |
20 | 18 | BASE_DIR = Path(__file__).resolve().parent.parent |
21 | 19 |
|
22 | 20 |
|
23 | 21 | # Quick-start development settings - unsuitable for production |
24 | | -# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ |
| 22 | +# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ |
25 | 23 |
|
26 | 24 | # SECURITY WARNING: keep the secret key used in production secret! |
27 | | -SECRET_KEY = os.getenv("SECRET_KEY") |
| 25 | +SECRET_KEY = config("SECRET_KEY") |
28 | 26 |
|
29 | 27 | # SECURITY WARNING: don't run with debug turned on in production! |
30 | | -DEBUG = os.getenv("DEBUG") |
| 28 | +DEBUG = config("DEBUG") |
31 | 29 |
|
32 | | -ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '').split(',') |
| 30 | +ALLOWED_HOSTS = config('ALLOWED_HOSTS', '').split(',') |
33 | 31 |
|
34 | 32 | if 'CODESPACE_NAME' in os.environ: |
35 | | - codespace_name = os.getenv("CODESPACE_NAME") |
36 | | - codespace_domain = os.getenv("GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN") |
| 33 | + codespace_name = config("CODESPACE_NAME") |
| 34 | + codespace_domain = config("GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN") |
37 | 35 | CSRF_TRUSTED_ORIGINS = [f'https://{codespace_name}-8000.{codespace_domain}'] |
38 | 36 |
|
39 | 37 | # Application definition |
|
83 | 81 |
|
84 | 82 |
|
85 | 83 | # Database |
86 | | -# https://docs.djangoproject.com/en/4.2/ref/settings/#databases |
| 84 | +# https://docs.djangoproject.com/en/5.0/ref/settings/#databases |
87 | 85 |
|
88 | 86 | DATABASES = { |
89 | 87 | "default": { |
|
113 | 111 |
|
114 | 112 |
|
115 | 113 | # Internationalization |
116 | | -# https://docs.djangoproject.com/en/4.2/topics/i18n/ |
| 114 | +# https://docs.djangoproject.com/en/5.0/topics/i18n/ |
117 | 115 |
|
118 | 116 | LANGUAGE_CODE = "en-us" |
119 | 117 |
|
|
125 | 123 |
|
126 | 124 |
|
127 | 125 | # Static files (CSS, JavaScript, Images) |
128 | | -# https://docs.djangoproject.com/en/4.2/howto/static-files/ |
| 126 | +# https://docs.djangoproject.com/en/5.0/howto/static-files/ |
129 | 127 |
|
130 | 128 | STATICFILES_DIRS = [ |
131 | 129 | BASE_DIR / "hello_world" / "static", |
|
139 | 137 |
|
140 | 138 |
|
141 | 139 | # Default primary key field type |
142 | | -# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field |
| 140 | +# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field |
143 | 141 |
|
144 | 142 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
0 commit comments