Spaces:
Running
Running
Update hsapssconnect/settings.py
Browse files- hsapssconnect/settings.py +180 -180
hsapssconnect/settings.py
CHANGED
@@ -1,180 +1,180 @@
|
|
1 |
-
"""
|
2 |
-
Django settings for hsapssconnect project.
|
3 |
-
|
4 |
-
Generated by 'django-admin startproject' using Django 5.0.6.
|
5 |
-
|
6 |
-
For more information on this file, see
|
7 |
-
https://docs.djangoproject.com/en/5.0/topics/settings/
|
8 |
-
|
9 |
-
For the full list of settings and their values, see
|
10 |
-
https://docs.djangoproject.com/en/5.0/ref/settings/
|
11 |
-
"""
|
12 |
-
|
13 |
-
from pathlib import Path
|
14 |
-
from datetime import timedelta
|
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/5.0/howto/deployment/checklist/
|
22 |
-
|
23 |
-
# SECURITY WARNING: keep the secret key used in production secret!
|
24 |
-
SECRET_KEY = "django-insecure-lde0hgz*y9#h@sbz_u6&=&=i9cef23em^sax91iqb_)1#2s*qd"
|
25 |
-
|
26 |
-
# SECURITY WARNING: don't run with debug turned on in production!
|
27 |
-
DEBUG = True
|
28 |
-
|
29 |
-
ALLOWED_HOSTS = ["*", "127.0.0.1", "localhost", "thejagstudio-connect.hf.space", "zjkjjkxf-8000.use.devtunnels.ms"]
|
30 |
-
CORS_ORIGIN_ALLOW_ALL = True
|
31 |
-
CORS_ALLOW_CREDENTIALS = True
|
32 |
-
CORS_ALLOWED_ORIGINS = ["https://thejagstudio-connect.hf.space", "https://zjkjjkxf-8000.use.devtunnels.ms"]
|
33 |
-
|
34 |
-
CSRF_TRUSTED_ORIGINS = ["https://thejagstudio-connect.hf.space", "https://zjkjjkxf-8000.use.devtunnels.ms"]
|
35 |
-
# SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
36 |
-
# SECURE_SSL_REDIRECT = True
|
37 |
-
# SESSION_COOKIE_SECURE = True
|
38 |
-
# CSRF_COOKIE_SECURE = True
|
39 |
-
|
40 |
-
|
41 |
-
# Application definition
|
42 |
-
|
43 |
-
INSTALLED_APPS = [
|
44 |
-
"django.contrib.admin",
|
45 |
-
"django.contrib.auth",
|
46 |
-
"django.contrib.contenttypes",
|
47 |
-
"django.contrib.sessions",
|
48 |
-
"django.contrib.messages",
|
49 |
-
"daphne",
|
50 |
-
"api",
|
51 |
-
"notification",
|
52 |
-
"corsheaders",
|
53 |
-
"import_export",
|
54 |
-
"rest_framework",
|
55 |
-
"rest_framework_simplejwt",
|
56 |
-
"rest_framework_simplejwt.token_blacklist",
|
57 |
-
"django.contrib.staticfiles",
|
58 |
-
]
|
59 |
-
|
60 |
-
MIDDLEWARE = [
|
61 |
-
"django.middleware.security.SecurityMiddleware",
|
62 |
-
"django.contrib.sessions.middleware.SessionMiddleware",
|
63 |
-
"corsheaders.middleware.CorsMiddleware",
|
64 |
-
"django.middleware.common.CommonMiddleware",
|
65 |
-
"django.middleware.csrf.CsrfViewMiddleware",
|
66 |
-
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
67 |
-
"django.contrib.messages.middleware.MessageMiddleware",
|
68 |
-
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
69 |
-
]
|
70 |
-
|
71 |
-
ROOT_URLCONF = "hsapssconnect.urls"
|
72 |
-
|
73 |
-
TEMPLATES = [
|
74 |
-
{
|
75 |
-
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
76 |
-
"DIRS": ["templates"],
|
77 |
-
"APP_DIRS": True,
|
78 |
-
"OPTIONS": {
|
79 |
-
"context_processors": [
|
80 |
-
"django.template.context_processors.debug",
|
81 |
-
"django.template.context_processors.request",
|
82 |
-
"django.contrib.auth.context_processors.auth",
|
83 |
-
"django.contrib.messages.context_processors.messages",
|
84 |
-
],
|
85 |
-
},
|
86 |
-
},
|
87 |
-
]
|
88 |
-
|
89 |
-
WSGI_APPLICATION = "hsapssconnect.wsgi.application"
|
90 |
-
ASGI_APPLICATION = "hsapssconnect.asgi.application"
|
91 |
-
CHANNEL_LAYERS = {
|
92 |
-
"default": {
|
93 |
-
"BACKEND": "channels.layers.InMemoryChannelLayer",
|
94 |
-
}
|
95 |
-
}
|
96 |
-
# Database
|
97 |
-
# https://docs.djangoproject.com/en/5.0/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 |
-
# "default": {
|
109 |
-
# "ENGINE": "django.db.backends.sqlite3",
|
110 |
-
# "NAME": BASE_DIR / "db.sqlite3",
|
111 |
-
# }
|
112 |
-
}
|
113 |
-
|
114 |
-
# Password validation
|
115 |
-
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
116 |
-
|
117 |
-
AUTH_PASSWORD_VALIDATORS = [
|
118 |
-
{
|
119 |
-
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
120 |
-
},
|
121 |
-
{
|
122 |
-
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
123 |
-
},
|
124 |
-
{
|
125 |
-
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
126 |
-
},
|
127 |
-
{
|
128 |
-
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
129 |
-
},
|
130 |
-
]
|
131 |
-
|
132 |
-
|
133 |
-
# Internationalization
|
134 |
-
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
135 |
-
|
136 |
-
LANGUAGE_CODE = "en-us"
|
137 |
-
|
138 |
-
TIME_ZONE = "
|
139 |
-
|
140 |
-
USE_I18N = True
|
141 |
-
|
142 |
-
USE_TZ = True
|
143 |
-
|
144 |
-
|
145 |
-
# Static files (CSS, JavaScript, Images)
|
146 |
-
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
147 |
-
|
148 |
-
STATIC_URL = "static/"
|
149 |
-
STATICFILES_DIRS = [
|
150 |
-
BASE_DIR / "static",
|
151 |
-
]
|
152 |
-
|
153 |
-
# Default primary key field type
|
154 |
-
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
155 |
-
|
156 |
-
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
157 |
-
AUTH_USER_MODEL = "api.Bhagat"
|
158 |
-
|
159 |
-
|
160 |
-
RECAPTCHA_SITE_KEY = "6LfDVWUqAAAAAOPlzTro2t51YeymYoz-Pt89tarF"
|
161 |
-
RECAPTCHA_SECRET_KEY = "6LfDVWUqAAAAACzIE4ZKx71R0smuDVJaV-GBLR66"
|
162 |
-
|
163 |
-
REST_FRAMEWORK = {
|
164 |
-
"DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",),
|
165 |
-
"DEFAULT_RENDERER_CLASSES": [
|
166 |
-
"rest_framework.renderers.JSONRenderer",
|
167 |
-
"rest_framework.renderers.BrowsableAPIRenderer",
|
168 |
-
],
|
169 |
-
}
|
170 |
-
|
171 |
-
SIMPLE_JWT = {
|
172 |
-
"ACCESS_TOKEN_LIFETIME": timedelta(days=60),
|
173 |
-
"REFRESH_TOKEN_LIFETIME": timedelta(days=120),
|
174 |
-
"ROTATE_REFRESH_TOKENS": False,
|
175 |
-
"ALGORITHM": "HS256",
|
176 |
-
"SIGNING_KEY": "HariPremci6fhen4G3iGpCE0IYrhLOPCWAvoxxVw",
|
177 |
-
"AUTH_HEADER_TYPES": ("Bearer",),
|
178 |
-
}
|
179 |
-
|
180 |
-
WEBPUSH_SETTINGS = {"VAPID_PUBLIC_KEY": "BOE7XX5MdzDx4thHOajMNZJj8C1LqGaa8X35O7hww5uzsvFyjFAcRZw71AUAYubeggvOoSvkB4nd1xtPkPFfB9U", "VAPID_PRIVATE_KEY": "gdd6ff_ti4W33uj23npZRIUZM6ViyTIOueHIv01Q7Lc", "VAPID_ADMIN_EMAIL": "[email protected]"}
|
|
|
1 |
+
"""
|
2 |
+
Django settings for hsapssconnect project.
|
3 |
+
|
4 |
+
Generated by 'django-admin startproject' using Django 5.0.6.
|
5 |
+
|
6 |
+
For more information on this file, see
|
7 |
+
https://docs.djangoproject.com/en/5.0/topics/settings/
|
8 |
+
|
9 |
+
For the full list of settings and their values, see
|
10 |
+
https://docs.djangoproject.com/en/5.0/ref/settings/
|
11 |
+
"""
|
12 |
+
|
13 |
+
from pathlib import Path
|
14 |
+
from datetime import timedelta
|
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/5.0/howto/deployment/checklist/
|
22 |
+
|
23 |
+
# SECURITY WARNING: keep the secret key used in production secret!
|
24 |
+
SECRET_KEY = "django-insecure-lde0hgz*y9#h@sbz_u6&=&=i9cef23em^sax91iqb_)1#2s*qd"
|
25 |
+
|
26 |
+
# SECURITY WARNING: don't run with debug turned on in production!
|
27 |
+
DEBUG = True
|
28 |
+
|
29 |
+
ALLOWED_HOSTS = ["*", "127.0.0.1", "localhost", "thejagstudio-connect.hf.space", "zjkjjkxf-8000.use.devtunnels.ms"]
|
30 |
+
CORS_ORIGIN_ALLOW_ALL = True
|
31 |
+
CORS_ALLOW_CREDENTIALS = True
|
32 |
+
CORS_ALLOWED_ORIGINS = ["https://thejagstudio-connect.hf.space", "https://zjkjjkxf-8000.use.devtunnels.ms"]
|
33 |
+
|
34 |
+
CSRF_TRUSTED_ORIGINS = ["https://thejagstudio-connect.hf.space", "https://zjkjjkxf-8000.use.devtunnels.ms"]
|
35 |
+
# SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
36 |
+
# SECURE_SSL_REDIRECT = True
|
37 |
+
# SESSION_COOKIE_SECURE = True
|
38 |
+
# CSRF_COOKIE_SECURE = True
|
39 |
+
|
40 |
+
|
41 |
+
# Application definition
|
42 |
+
|
43 |
+
INSTALLED_APPS = [
|
44 |
+
"django.contrib.admin",
|
45 |
+
"django.contrib.auth",
|
46 |
+
"django.contrib.contenttypes",
|
47 |
+
"django.contrib.sessions",
|
48 |
+
"django.contrib.messages",
|
49 |
+
"daphne",
|
50 |
+
"api",
|
51 |
+
"notification",
|
52 |
+
"corsheaders",
|
53 |
+
"import_export",
|
54 |
+
"rest_framework",
|
55 |
+
"rest_framework_simplejwt",
|
56 |
+
"rest_framework_simplejwt.token_blacklist",
|
57 |
+
"django.contrib.staticfiles",
|
58 |
+
]
|
59 |
+
|
60 |
+
MIDDLEWARE = [
|
61 |
+
"django.middleware.security.SecurityMiddleware",
|
62 |
+
"django.contrib.sessions.middleware.SessionMiddleware",
|
63 |
+
"corsheaders.middleware.CorsMiddleware",
|
64 |
+
"django.middleware.common.CommonMiddleware",
|
65 |
+
"django.middleware.csrf.CsrfViewMiddleware",
|
66 |
+
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
67 |
+
"django.contrib.messages.middleware.MessageMiddleware",
|
68 |
+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
69 |
+
]
|
70 |
+
|
71 |
+
ROOT_URLCONF = "hsapssconnect.urls"
|
72 |
+
|
73 |
+
TEMPLATES = [
|
74 |
+
{
|
75 |
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
76 |
+
"DIRS": ["templates"],
|
77 |
+
"APP_DIRS": True,
|
78 |
+
"OPTIONS": {
|
79 |
+
"context_processors": [
|
80 |
+
"django.template.context_processors.debug",
|
81 |
+
"django.template.context_processors.request",
|
82 |
+
"django.contrib.auth.context_processors.auth",
|
83 |
+
"django.contrib.messages.context_processors.messages",
|
84 |
+
],
|
85 |
+
},
|
86 |
+
},
|
87 |
+
]
|
88 |
+
|
89 |
+
WSGI_APPLICATION = "hsapssconnect.wsgi.application"
|
90 |
+
ASGI_APPLICATION = "hsapssconnect.asgi.application"
|
91 |
+
CHANNEL_LAYERS = {
|
92 |
+
"default": {
|
93 |
+
"BACKEND": "channels.layers.InMemoryChannelLayer",
|
94 |
+
}
|
95 |
+
}
|
96 |
+
# Database
|
97 |
+
# https://docs.djangoproject.com/en/5.0/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 |
+
# "default": {
|
109 |
+
# "ENGINE": "django.db.backends.sqlite3",
|
110 |
+
# "NAME": BASE_DIR / "db.sqlite3",
|
111 |
+
# }
|
112 |
+
}
|
113 |
+
|
114 |
+
# Password validation
|
115 |
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
116 |
+
|
117 |
+
AUTH_PASSWORD_VALIDATORS = [
|
118 |
+
{
|
119 |
+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
120 |
+
},
|
121 |
+
{
|
122 |
+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
126 |
+
},
|
127 |
+
{
|
128 |
+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
129 |
+
},
|
130 |
+
]
|
131 |
+
|
132 |
+
|
133 |
+
# Internationalization
|
134 |
+
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
135 |
+
|
136 |
+
LANGUAGE_CODE = "en-us"
|
137 |
+
|
138 |
+
TIME_ZONE = "America/New_York"
|
139 |
+
|
140 |
+
USE_I18N = True
|
141 |
+
|
142 |
+
USE_TZ = True
|
143 |
+
|
144 |
+
|
145 |
+
# Static files (CSS, JavaScript, Images)
|
146 |
+
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
147 |
+
|
148 |
+
STATIC_URL = "static/"
|
149 |
+
STATICFILES_DIRS = [
|
150 |
+
BASE_DIR / "static",
|
151 |
+
]
|
152 |
+
|
153 |
+
# Default primary key field type
|
154 |
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
155 |
+
|
156 |
+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
157 |
+
AUTH_USER_MODEL = "api.Bhagat"
|
158 |
+
|
159 |
+
|
160 |
+
RECAPTCHA_SITE_KEY = "6LfDVWUqAAAAAOPlzTro2t51YeymYoz-Pt89tarF"
|
161 |
+
RECAPTCHA_SECRET_KEY = "6LfDVWUqAAAAACzIE4ZKx71R0smuDVJaV-GBLR66"
|
162 |
+
|
163 |
+
REST_FRAMEWORK = {
|
164 |
+
"DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",),
|
165 |
+
"DEFAULT_RENDERER_CLASSES": [
|
166 |
+
"rest_framework.renderers.JSONRenderer",
|
167 |
+
"rest_framework.renderers.BrowsableAPIRenderer",
|
168 |
+
],
|
169 |
+
}
|
170 |
+
|
171 |
+
SIMPLE_JWT = {
|
172 |
+
"ACCESS_TOKEN_LIFETIME": timedelta(days=60),
|
173 |
+
"REFRESH_TOKEN_LIFETIME": timedelta(days=120),
|
174 |
+
"ROTATE_REFRESH_TOKENS": False,
|
175 |
+
"ALGORITHM": "HS256",
|
176 |
+
"SIGNING_KEY": "HariPremci6fhen4G3iGpCE0IYrhLOPCWAvoxxVw",
|
177 |
+
"AUTH_HEADER_TYPES": ("Bearer",),
|
178 |
+
}
|
179 |
+
|
180 |
+
WEBPUSH_SETTINGS = {"VAPID_PUBLIC_KEY": "BOE7XX5MdzDx4thHOajMNZJj8C1LqGaa8X35O7hww5uzsvFyjFAcRZw71AUAYubeggvOoSvkB4nd1xtPkPFfB9U", "VAPID_PRIVATE_KEY": "gdd6ff_ti4W33uj23npZRIUZM6ViyTIOueHIv01Q7Lc", "VAPID_ADMIN_EMAIL": "[email protected]"}
|