Spaces:
Sleeping
Sleeping
Update oneOone/settings.py
Browse files- oneOone/settings.py +174 -170
oneOone/settings.py
CHANGED
@@ -1,170 +1,174 @@
|
|
1 |
-
"""
|
2 |
-
Django settings for oneOone project.
|
3 |
-
|
4 |
-
Generated by 'django-admin startproject' using Django 4.2.16.
|
5 |
-
|
6 |
-
For more information on this file, see
|
7 |
-
https://docs.djangoproject.com/en/4.2/topics/settings/
|
8 |
-
|
9 |
-
For the full list of settings and their values, see
|
10 |
-
https://docs.djangoproject.com/en/4.2/ref/settings/
|
11 |
-
"""
|
12 |
-
|
13 |
-
from datetime import timedelta
|
14 |
-
from pathlib import Path
|
15 |
-
|
16 |
-
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
17 |
-
BASE_DIR = Path(__file__).resolve().parent.parent
|
18 |
-
|
19 |
-
|
20 |
-
# Quick-start development settings - unsuitable for production
|
21 |
-
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
22 |
-
|
23 |
-
# SECURITY WARNING: keep the secret key used in production secret!
|
24 |
-
SECRET_KEY = "django-insecure-8&2s2s)--3hof($4+pkt0@$l1tz8so+$t=%yq9y0on=s$2_^$p"
|
25 |
-
|
26 |
-
# SECURITY WARNING: don't run with debug turned on in production!
|
27 |
-
DEBUG = True
|
28 |
-
|
29 |
-
ALLOWED_HOSTS = ["*", "127.0.0.1", "192.168.81.1", "192.168.12.61"]
|
30 |
-
CORS_ALLOWED_ORIGINS = [
|
31 |
-
"http://localhost:8081",
|
32 |
-
"http://localhost:19006",
|
33 |
-
"http://192.168.81.1:8000",
|
34 |
-
"http://192.168.12.61:8000",
|
35 |
-
"https://s4t6xdgk-8000.inc1.devtunnels.ms"
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
"http://
|
41 |
-
"http://
|
42 |
-
"
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
"django.contrib.
|
53 |
-
"django.contrib.
|
54 |
-
"
|
55 |
-
"
|
56 |
-
"
|
57 |
-
"
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
"
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
"django.middleware.
|
66 |
-
"django.contrib.
|
67 |
-
"
|
68 |
-
"django.middleware.
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
'
|
102 |
-
'
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
#
|
112 |
-
#
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
#
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
'
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Django settings for oneOone project.
|
3 |
+
|
4 |
+
Generated by 'django-admin startproject' using Django 4.2.16.
|
5 |
+
|
6 |
+
For more information on this file, see
|
7 |
+
https://docs.djangoproject.com/en/4.2/topics/settings/
|
8 |
+
|
9 |
+
For the full list of settings and their values, see
|
10 |
+
https://docs.djangoproject.com/en/4.2/ref/settings/
|
11 |
+
"""
|
12 |
+
|
13 |
+
from datetime import timedelta
|
14 |
+
from pathlib import Path
|
15 |
+
|
16 |
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
17 |
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
18 |
+
|
19 |
+
|
20 |
+
# Quick-start development settings - unsuitable for production
|
21 |
+
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
22 |
+
|
23 |
+
# SECURITY WARNING: keep the secret key used in production secret!
|
24 |
+
SECRET_KEY = "django-insecure-8&2s2s)--3hof($4+pkt0@$l1tz8so+$t=%yq9y0on=s$2_^$p"
|
25 |
+
|
26 |
+
# SECURITY WARNING: don't run with debug turned on in production!
|
27 |
+
DEBUG = True
|
28 |
+
|
29 |
+
ALLOWED_HOSTS = ["*", "127.0.0.1", "192.168.81.1", "192.168.12.61", "thejagstudio-101.hf.space"]
|
30 |
+
CORS_ALLOWED_ORIGINS = [
|
31 |
+
"http://localhost:8081",
|
32 |
+
"http://localhost:19006",
|
33 |
+
"http://192.168.81.1:8000",
|
34 |
+
"http://192.168.12.61:8000",
|
35 |
+
"https://s4t6xdgk-8000.inc1.devtunnels.ms",
|
36 |
+
"http://thejagstudio-101.hf.space",
|
37 |
+
"https://thejagstudio-101.hf.space"
|
38 |
+
]
|
39 |
+
CSRF_TRUSTED_ORIGINS = [
|
40 |
+
"http://localhost:8081",
|
41 |
+
"http://192.168.81.1:8000",
|
42 |
+
"http://192.168.12.61:8000",
|
43 |
+
"http://localhost:19006",
|
44 |
+
"https://s4t6xdgk-8000.inc1.devtunnels.ms",
|
45 |
+
"http://thejagstudio-101.hf.space",
|
46 |
+
"https://thejagstudio-101.hf.space"
|
47 |
+
]
|
48 |
+
|
49 |
+
# Application definition
|
50 |
+
|
51 |
+
INSTALLED_APPS = [
|
52 |
+
"django.contrib.admin",
|
53 |
+
"django.contrib.auth",
|
54 |
+
"django.contrib.contenttypes",
|
55 |
+
"django.contrib.sessions",
|
56 |
+
"django.contrib.messages",
|
57 |
+
"django.contrib.staticfiles",
|
58 |
+
"rest_framework",
|
59 |
+
"rest_framework_simplejwt",
|
60 |
+
"import_export",
|
61 |
+
"corsheaders"
|
62 |
+
]
|
63 |
+
|
64 |
+
MIDDLEWARE = [
|
65 |
+
"django.middleware.security.SecurityMiddleware",
|
66 |
+
"django.contrib.sessions.middleware.SessionMiddleware",
|
67 |
+
"corsheaders.middleware.CorsMiddleware",
|
68 |
+
"django.middleware.common.CommonMiddleware",
|
69 |
+
"django.middleware.csrf.CsrfViewMiddleware",
|
70 |
+
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
71 |
+
"django.contrib.messages.middleware.MessageMiddleware",
|
72 |
+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
73 |
+
]
|
74 |
+
|
75 |
+
ROOT_URLCONF = "oneOone.urls"
|
76 |
+
|
77 |
+
TEMPLATES = [
|
78 |
+
{
|
79 |
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
80 |
+
"DIRS": [],
|
81 |
+
"APP_DIRS": True,
|
82 |
+
"OPTIONS": {
|
83 |
+
"context_processors": [
|
84 |
+
"django.template.context_processors.debug",
|
85 |
+
"django.template.context_processors.request",
|
86 |
+
"django.contrib.auth.context_processors.auth",
|
87 |
+
"django.contrib.messages.context_processors.messages",
|
88 |
+
],
|
89 |
+
},
|
90 |
+
},
|
91 |
+
]
|
92 |
+
|
93 |
+
WSGI_APPLICATION = "oneOone.wsgi.application"
|
94 |
+
|
95 |
+
|
96 |
+
# Database
|
97 |
+
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
98 |
+
|
99 |
+
DATABASES = {
|
100 |
+
'default': {
|
101 |
+
'ENGINE': 'django.db.backends.postgresql',
|
102 |
+
'NAME': 'postgres',
|
103 |
+
'USER': 'postgres.psjobjezrtkjvenhsmge',
|
104 |
+
'PORT': 6543,
|
105 |
+
'PASSWORD': 'ErO9vgKcwCA1bdah',
|
106 |
+
'HOST': 'aws-0-us-east-1.pooler.supabase.com',
|
107 |
+
}
|
108 |
+
}
|
109 |
+
# "default": {
|
110 |
+
# "ENGINE": "django.db.backends.sqlite3",
|
111 |
+
# "NAME": BASE_DIR / "db.sqlite3",
|
112 |
+
# }
|
113 |
+
|
114 |
+
|
115 |
+
# Password validation
|
116 |
+
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
|
117 |
+
|
118 |
+
AUTH_PASSWORD_VALIDATORS = [
|
119 |
+
{
|
120 |
+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
121 |
+
},
|
122 |
+
{
|
123 |
+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
124 |
+
},
|
125 |
+
{
|
126 |
+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
127 |
+
},
|
128 |
+
{
|
129 |
+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
130 |
+
},
|
131 |
+
]
|
132 |
+
|
133 |
+
|
134 |
+
# Internationalization
|
135 |
+
# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
136 |
+
|
137 |
+
LANGUAGE_CODE = "en-us"
|
138 |
+
|
139 |
+
TIME_ZONE = "UTC"
|
140 |
+
|
141 |
+
USE_I18N = True
|
142 |
+
|
143 |
+
USE_TZ = True
|
144 |
+
|
145 |
+
|
146 |
+
# Static files (CSS, JavaScript, Images)
|
147 |
+
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
148 |
+
|
149 |
+
STATIC_URL = "static/"
|
150 |
+
|
151 |
+
# Default primary key field type
|
152 |
+
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
153 |
+
|
154 |
+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
155 |
+
|
156 |
+
REST_FRAMEWORK = {
|
157 |
+
'DEFAULT_AUTHENTICATION_CLASSES': (
|
158 |
+
'rest_framework_simplejwt.authentication.JWTAuthentication',
|
159 |
+
),
|
160 |
+
'DEFAULT_PERMISSION_CLASSES': (
|
161 |
+
'rest_framework.permissions.AllowAny',
|
162 |
+
),
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
SIMPLE_JWT = {
|
167 |
+
'ACCESS_TOKEN_LIFETIME': timedelta(minutes=5),
|
168 |
+
'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
|
169 |
+
'ROTATE_REFRESH_TOKENS': True,
|
170 |
+
'BLACKLIST_AFTER_ROTATION': True,
|
171 |
+
'UPDATE_LAST_LOGIN': False,
|
172 |
+
}
|
173 |
+
|
174 |
+
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|