|
1 | 1 | """ |
2 | 2 | Django settings for web_project project. |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 2.1.1. |
| 4 | +Generated by 'django-admin startproject' using Django 3.1.5. |
5 | 5 |
|
6 | 6 | For more information on this file, see |
7 | | -https://docs.djangoproject.com/en/2.1/topics/settings/ |
| 7 | +https://docs.djangoproject.com/en/3.1/topics/settings/ |
8 | 8 |
|
9 | 9 | For the full list of settings and their values, see |
10 | | -https://docs.djangoproject.com/en/2.1/ref/settings/ |
| 10 | +https://docs.djangoproject.com/en/3.1/ref/settings/ |
11 | 11 | """ |
12 | 12 |
|
13 | | -import os |
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__))) |
| 13 | +from pathlib import Path |
17 | 14 |
|
| 15 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 16 | +BASE_DIR = Path(__file__).resolve().parent.parent |
18 | 17 |
|
19 | 18 | # Quick-start development settings - unsuitable for production |
20 | | -# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ |
| 19 | +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
21 | 20 |
|
22 | 21 | # SECURITY WARNING: keep the secret key used in production secret! |
23 | | -SECRET_KEY = '2gult1d96#@#b2%tz+k9x1q%-4(%f@va-!sbv*q&$t^gpp8-_=' |
| 22 | +SECRET_KEY = '6cskd7@vosz+^h5org$_jjq)l$ai-05q8-g^^$tdb$x*ud7e0=' |
24 | 23 |
|
25 | 24 | # SECURITY WARNING: don't run with debug turned on in production! |
26 | | -# If you set to False, also add "localhost" to ALLOWED_HOSTS or else |
27 | | -# you'll get "Bad Request" when running locally. |
28 | 25 | DEBUG = True |
29 | 26 |
|
30 | 27 | # When deploying to Azure App Service, add you <name>.azurewebsites.net |
|
81 | 78 |
|
82 | 79 |
|
83 | 80 | # Database |
84 | | -# https://docs.djangoproject.com/en/2.1/ref/settings/#databases |
| 81 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases |
85 | 82 |
|
86 | 83 | DATABASES = { |
87 | 84 | 'default': { |
88 | 85 | 'ENGINE': 'django.db.backends.sqlite3', |
89 | | - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
| 86 | + 'NAME': BASE_DIR / 'db.sqlite3', |
90 | 87 | } |
91 | 88 | } |
92 | 89 |
|
93 | 90 |
|
94 | 91 | # Password validation |
95 | | -# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators |
| 92 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators |
96 | 93 |
|
97 | 94 | AUTH_PASSWORD_VALIDATORS = [ |
98 | 95 | { |
|
111 | 108 |
|
112 | 109 |
|
113 | 110 | # Internationalization |
114 | | -# https://docs.djangoproject.com/en/2.1/topics/i18n/ |
| 111 | +# https://docs.djangoproject.com/en/3.1/topics/i18n/ |
115 | 112 |
|
116 | 113 | LANGUAGE_CODE = 'en-us' |
117 | 114 |
|
|
125 | 122 |
|
126 | 123 |
|
127 | 124 | # Static files (CSS, JavaScript, Images) |
128 | | -# https://docs.djangoproject.com/en/2.1/howto/static-files/ |
| 125 | +# https://docs.djangoproject.com/en/3.1/howto/static-files/ |
129 | 126 |
|
130 | 127 | STATIC_URL = '/static/' |
131 | 128 |
|
132 | 129 | # The location where the collectstatic command collects static files from apps. |
133 | 130 | # A dedicated static file server is typically used in production to serve files |
134 | 131 | # from this location, rather than relying on the app server to serve those files |
135 | 132 | # from various locations in the app. Doing so results in better overall performance. |
136 | | -STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected') |
| 133 | +STATIC_ROOT = BASE_DIR / 'static_collected' |
0 commit comments