|
1 | | -"""Django settings for locallibrary project. |
| 1 | +""" |
| 2 | +Django settings for locallibrary project. |
2 | 3 |
|
3 | | -Generated by 'django-admin startproject' using Django 2.1.5. |
| 4 | +Generated by 'django-admin startproject' using Django 3.1.2. |
4 | 5 |
|
5 | 6 | For more information on this file, see |
6 | | -https://docs.djangoproject.com/en/2.1/topics/settings/ |
| 7 | +https://docs.djangoproject.com/en/3.1/topics/settings/ |
7 | 8 |
|
8 | 9 | For the full list of settings and their values, see |
9 | | -https://docs.djangoproject.com/en/2.1/ref/settings/ |
| 10 | +https://docs.djangoproject.com/en/3.1/ref/settings/ |
10 | 11 | """ |
11 | 12 |
|
12 | | -import os |
| 13 | +from pathlib import Path |
13 | 14 |
|
14 | | -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
15 | | -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 |
16 | 17 |
|
17 | 18 |
|
18 | 19 | # Quick-start development settings - unsuitable for production |
19 | | -# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ |
| 20 | +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
20 | 21 |
|
21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! |
22 | 23 | #SECRET_KEY = 'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag' |
|
77 | 78 |
|
78 | 79 |
|
79 | 80 | # Database |
80 | | -# https://docs.djangoproject.com/en/2.1/ref/settings/#databases |
| 81 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases |
81 | 82 |
|
82 | 83 | DATABASES = { |
83 | 84 | 'default': { |
84 | 85 | 'ENGINE': 'django.db.backends.sqlite3', |
85 | | - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
| 86 | + 'NAME': BASE_DIR / 'db.sqlite3', |
86 | 87 | } |
87 | 88 | } |
88 | 89 |
|
89 | 90 |
|
90 | 91 | # Password validation |
91 | | -# 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 |
92 | 93 |
|
93 | 94 | AUTH_PASSWORD_VALIDATORS = [ |
94 | 95 | { |
|
107 | 108 |
|
108 | 109 |
|
109 | 110 | # Internationalization |
110 | | -# https://docs.djangoproject.com/en/2.1/topics/i18n/ |
| 111 | +# https://docs.djangoproject.com/en/3.1/topics/i18n/ |
111 | 112 |
|
112 | 113 | LANGUAGE_CODE = 'en-us' |
113 | 114 |
|
|
137 | 138 |
|
138 | 139 |
|
139 | 140 | # Static files (CSS, JavaScript, Images) |
140 | | -# https://docs.djangoproject.com/en/2.1/howto/static-files/ |
| 141 | +# https://docs.djangoproject.com/en/3.1/howto/static-files/ |
141 | 142 | # The absolute path to the directory where collectstatic will collect static files for deployment. |
142 | | -STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') |
| 143 | +STATIC_ROOT = BASE_DIR / 'staticfiles' #. os.path.join(BASE_DIR, 'staticfiles') |
143 | 144 | # The URL to use when referring to static files (where they will be served from) |
144 | 145 | STATIC_URL = '/static/' |
145 | 146 |
|
|
0 commit comments