|
1 | 1 | """ |
2 | 2 | Django settings for helloworld project. |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 2.2.3. |
| 4 | +Generated by 'django-admin startproject' using Django 5.1.6. |
5 | 5 |
|
6 | 6 | For more information on this file, see |
7 | | -https://docs.djangoproject.com/en/2.2/topics/settings/ |
| 7 | +https://docs.djangoproject.com/en/5.1/topics/settings/ |
8 | 8 |
|
9 | 9 | For the full list of settings and their values, see |
10 | | -https://docs.djangoproject.com/en/2.2/ref/settings/ |
| 10 | +https://docs.djangoproject.com/en/5.1/ref/settings/ |
11 | 11 | """ |
12 | 12 |
|
13 | | -import os |
| 13 | +from pathlib import Path |
14 | 14 |
|
15 | | -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
16 | | -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 15 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 16 | +BASE_DIR = Path(__file__).resolve().parent.parent |
17 | 17 |
|
18 | 18 |
|
19 | 19 | # Quick-start development settings - unsuitable for production |
20 | | -# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ |
| 20 | +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ |
21 | 21 |
|
22 | 22 | # SECURITY WARNING: keep the secret key used in production secret! |
23 | | -SECRET_KEY = 'matxp6k!wbkmdlk)97)ew2qr%&9nr=n#v_-+v#yel4^r&czf7q' |
| 23 | +SECRET_KEY = 'django-insecure-sokpy*q9_=6j-9mrh_l)*k+&im(xfbxz_8=&u536n@9s)9&*gv' |
24 | 24 |
|
25 | 25 | # SECURITY WARNING: don't run with debug turned on in production! |
26 | 26 | DEBUG = True |
|
72 | 72 |
|
73 | 73 |
|
74 | 74 | # Database |
75 | | -# https://docs.djangoproject.com/en/2.2/ref/settings/#databases |
| 75 | +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases |
76 | 76 |
|
77 | 77 | DATABASES = { |
78 | 78 | 'default': { |
79 | 79 | 'ENGINE': 'django.db.backends.sqlite3', |
80 | | - 'NAME': os.path.join(BASE_DIR, 'helloworld.db'), |
| 80 | + 'NAME': BASE_DIR / 'helloworld.sqlite3', |
81 | 81 | } |
82 | 82 | } |
83 | 83 |
|
84 | 84 |
|
85 | 85 | # Password validation |
86 | | -# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators |
| 86 | +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators |
87 | 87 |
|
88 | 88 | AUTH_PASSWORD_VALIDATORS = [ |
89 | 89 | { |
|
102 | 102 |
|
103 | 103 |
|
104 | 104 | # Internationalization |
105 | | -# https://docs.djangoproject.com/en/2.2/topics/i18n/ |
| 105 | +# https://docs.djangoproject.com/en/5.1/topics/i18n/ |
106 | 106 |
|
107 | 107 | LANGUAGE_CODE = 'en-us' |
108 | 108 |
|
|
112 | 112 | # to load the internationalization machinery. |
113 | 113 | USE_I18N = True |
114 | 114 |
|
115 | | -# If you set this to False, Django will not format dates, numbers and |
116 | | -# calendars according to the current locale |
117 | | -USE_L10N = True |
118 | | - |
| 115 | +# If you set this to False, Django will not use timezone-aware datetimes. |
119 | 116 | USE_TZ = True |
120 | 117 |
|
121 | 118 |
|
122 | 119 | # Static files (CSS, JavaScript, Images) |
123 | | -# https://docs.djangoproject.com/en/2.2/howto/static-files/ |
| 120 | +# https://docs.djangoproject.com/en/5.1/howto/static-files/ |
| 121 | + |
| 122 | +STATIC_URL = 'static/' |
| 123 | +STATICFILES_DIRS = [ |
| 124 | + BASE_DIR / "static", |
| 125 | +] |
| 126 | + |
| 127 | +# Default primary key field type |
| 128 | +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field |
124 | 129 |
|
125 | | -STATIC_URL = '/static/' |
| 130 | +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' |
0 commit comments