|
1 | 1 | """ |
2 | 2 | Django settings for django_web_app project. |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 1.9.7. |
| 4 | +Generated by 'django-admin startproject' using Django 4.0. |
5 | 5 |
|
6 | 6 | For more information on this file, see |
7 | | -https://docs.djangoproject.com/en/1.9/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/1.9/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/1.9/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 = '6ky7k!%v9u#p!m%))=zn2(qc&=12y72)^nd%#pu@$wuvzk3p0$' |
| 23 | +SECRET_KEY = 'django-insecure-2#sh(s&7s!oy^y3hti86)slp=67hivo12la+hhly%kag$!e!c!' |
24 | 24 |
|
25 | 25 | # SECURITY WARNING: don't run with debug turned on in production! |
26 | 26 | DEBUG = True |
27 | 27 |
|
28 | | -ALLOWED_HOSTS = [] |
| 28 | +ALLOWED_HOSTS = ['*'] |
29 | 29 |
|
30 | 30 |
|
31 | 31 | # Application definition |
|
39 | 39 | 'django.contrib.staticfiles', |
40 | 40 | ] |
41 | 41 |
|
42 | | -MIDDLEWARE_CLASSES = [ |
| 42 | +MIDDLEWARE = [ |
43 | 43 | 'django.middleware.security.SecurityMiddleware', |
| 44 | + 'whitenoise.middleware.WhiteNoiseMiddleware', |
44 | 45 | 'django.contrib.sessions.middleware.SessionMiddleware', |
45 | 46 | 'django.middleware.common.CommonMiddleware', |
46 | 47 | 'django.middleware.csrf.CsrfViewMiddleware', |
47 | 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
48 | | - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
49 | 49 | 'django.contrib.messages.middleware.MessageMiddleware', |
50 | 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
51 | 51 | ] |
|
72 | 72 |
|
73 | 73 |
|
74 | 74 | # Database |
75 | | -# https://docs.djangoproject.com/en/1.9/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/1.9/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/1.9/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 | | - |
118 | | -# Static files (CSS, JavaScript, Images) |
119 | | -# https://docs.djangoproject.com/en/1.9/howto/static-files/ |
120 | | - |
121 | 115 | STATIC_URL = '/static/' |
122 | 116 | STATIC_ROOT = 'static_root' |
0 commit comments