|
1 | 1 | """ |
2 | 2 | Django settings for django_example project. |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 2.2.1. |
| 4 | +Generated by 'django-admin startproject' using Django 4.0.1. |
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/4.0/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/4.0/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/4.0/howto/deployment/checklist/ |
21 | 21 |
|
22 | 22 | # SECURITY WARNING: keep the secret key used in production secret! |
23 | | -SECRET_KEY = 'un)em+=^3tu@vc+p)04=o!-3%@+*3#f6^syltxlho6n7ee(zq+' |
| 23 | +SECRET_KEY = 'django-insecure-5nh*_5n=4g^znmscg315mw1lzpuv=4=vj(pfd-7z7gql^6i#+%' |
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/4.0/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, 'db.sqlite3'), |
| 80 | + 'NAME': BASE_DIR / 'db.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/4.0/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/4.0/topics/i18n/ |
106 | 106 |
|
107 | 107 | LANGUAGE_CODE = 'en-us' |
108 | 108 |
|
109 | 109 | TIME_ZONE = 'UTC' |
110 | 110 |
|
111 | 111 | USE_I18N = True |
112 | 112 |
|
113 | | -USE_L10N = True |
114 | | - |
115 | 113 | USE_TZ = True |
116 | 114 |
|
117 | 115 |
|
118 | 116 | # Static files (CSS, JavaScript, Images) |
119 | | -# https://docs.djangoproject.com/en/2.2/howto/static-files/ |
| 117 | +# https://docs.djangoproject.com/en/4.0/howto/static-files/ |
| 118 | + |
| 119 | +STATIC_URL = 'static/' |
| 120 | + |
| 121 | +# Default primary key field type |
| 122 | +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field |
120 | 123 |
|
121 | | -STATIC_URL = '/static/' |
| 124 | +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' |
0 commit comments