Spaces:
Sleeping
Sleeping
Update voiceassist/settings.py
Browse files- voiceassist/settings.py +162 -162
voiceassist/settings.py
CHANGED
@@ -1,162 +1,162 @@
|
|
1 |
-
"""
|
2 |
-
Django settings for voiceassist 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 |
-
import os
|
15 |
-
import mimetypes
|
16 |
-
mimetypes.add_type("text/css", ".css", True)
|
17 |
-
mimetypes.add_type("application/javascript", ".js", True)
|
18 |
-
mimetypes.add_type("image/svg+xml", ".svg", True)
|
19 |
-
mimetypes.add_type("image/png", ".png", True)
|
20 |
-
mimetypes.add_type("image/jpeg", ".jpg", True)
|
21 |
-
mimetypes.add_type("image/jpeg", ".jpeg", True)
|
22 |
-
mimetypes.add_type("image/gif", ".gif", True)
|
23 |
-
mimetypes.add_type("image/webp", ".webp", True)
|
24 |
-
mimetypes.add_type("document/html", ".html", True)
|
25 |
-
mimetypes.add_type("document/html", ".htm", True)
|
26 |
-
mimetypes.add_type("application/json", ".json", True)
|
27 |
-
mimetypes.add_type("application/xml", ".xml", True)
|
28 |
-
|
29 |
-
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
30 |
-
BASE_DIR = Path(__file__).resolve().parent.parent
|
31 |
-
|
32 |
-
|
33 |
-
# Quick-start development settings - unsuitable for production
|
34 |
-
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
35 |
-
|
36 |
-
# SECURITY WARNING: keep the secret key used in production secret!
|
37 |
-
SECRET_KEY = "django-insecure-qx!bso^+a%d!fuu9ti6i_)^hv(1iunmkha9le#4(%y$6v3vzrf"
|
38 |
-
|
39 |
-
# SECURITY WARNING: don't run with debug turned on in production!
|
40 |
-
DEBUG = True
|
41 |
-
|
42 |
-
ALLOWED_HOSTS = ["*"]
|
43 |
-
|
44 |
-
CORS_ORIGIN_ALLOW_ALL = True
|
45 |
-
|
46 |
-
REACT_APP_BUILD_PATH = "vafront/dist"
|
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 |
-
"corsheaders",
|
59 |
-
"react",
|
60 |
-
"api",
|
61 |
-
"import_export"
|
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 = "voiceassist.urls"
|
76 |
-
SETTINGS_PATH = Path(__file__).resolve().parent.parent
|
77 |
-
TEMPLATE_DIRS = (
|
78 |
-
os.path.join(SETTINGS_PATH, 'vafront\\dist'),
|
79 |
-
"templates"
|
80 |
-
)
|
81 |
-
TEMPLATES = [
|
82 |
-
{
|
83 |
-
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
84 |
-
"DIRS": TEMPLATE_DIRS,
|
85 |
-
"APP_DIRS": True,
|
86 |
-
"OPTIONS": {
|
87 |
-
"context_processors": [
|
88 |
-
"django.template.context_processors.debug",
|
89 |
-
"django.template.context_processors.request",
|
90 |
-
"django.contrib.auth.context_processors.auth",
|
91 |
-
"django.contrib.messages.context_processors.messages",
|
92 |
-
],
|
93 |
-
},
|
94 |
-
},
|
95 |
-
]
|
96 |
-
|
97 |
-
WSGI_APPLICATION = "voiceassist.wsgi.application"
|
98 |
-
|
99 |
-
|
100 |
-
# Database
|
101 |
-
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
102 |
-
|
103 |
-
# "default": {
|
104 |
-
# "ENGINE": "django.db.backends.sqlite3",
|
105 |
-
# "NAME": str(BASE_DIR / "db.sqlite3"),
|
106 |
-
# }
|
107 |
-
DATABASES = {
|
108 |
-
"default": {
|
109 |
-
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
110 |
-
'NAME': 'postgres',
|
111 |
-
'USER': 'postgres.vwsicmdxnmlqrrpqvpqk',
|
112 |
-
'PASSWORD': 'nsEaNAJyzOQsLxgM',
|
113 |
-
'HOST': 'aws-0-us-east-1.pooler.supabase.com',
|
114 |
-
'PORT': '6543',
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
|
119 |
-
# Password validation
|
120 |
-
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
121 |
-
|
122 |
-
AUTH_PASSWORD_VALIDATORS = [
|
123 |
-
{
|
124 |
-
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
125 |
-
},
|
126 |
-
{
|
127 |
-
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
128 |
-
},
|
129 |
-
{
|
130 |
-
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
131 |
-
},
|
132 |
-
{
|
133 |
-
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
134 |
-
},
|
135 |
-
]
|
136 |
-
|
137 |
-
|
138 |
-
# Internationalization
|
139 |
-
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
140 |
-
|
141 |
-
LANGUAGE_CODE = "en-us"
|
142 |
-
|
143 |
-
TIME_ZONE = "UTC"
|
144 |
-
|
145 |
-
USE_I18N = True
|
146 |
-
|
147 |
-
USE_TZ = True
|
148 |
-
|
149 |
-
|
150 |
-
# Static files (CSS, JavaScript, Images)
|
151 |
-
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
152 |
-
|
153 |
-
STATIC_URL = "static/"
|
154 |
-
STATIC_DIR = ["/static/", BASE_DIR / REACT_APP_BUILD_PATH]
|
155 |
-
STATIC_ROOT = BASE_DIR / "static"
|
156 |
-
MEDIA_ROOT = BASE_DIR / "media"
|
157 |
-
MEDIA_URL = "/media/"
|
158 |
-
|
159 |
-
# Default primary key field type
|
160 |
-
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
161 |
-
|
162 |
-
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
|
1 |
+
"""
|
2 |
+
Django settings for voiceassist 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 |
+
import os
|
15 |
+
import mimetypes
|
16 |
+
mimetypes.add_type("text/css", ".css", True)
|
17 |
+
mimetypes.add_type("application/javascript", ".js", True)
|
18 |
+
mimetypes.add_type("image/svg+xml", ".svg", True)
|
19 |
+
mimetypes.add_type("image/png", ".png", True)
|
20 |
+
mimetypes.add_type("image/jpeg", ".jpg", True)
|
21 |
+
mimetypes.add_type("image/jpeg", ".jpeg", True)
|
22 |
+
mimetypes.add_type("image/gif", ".gif", True)
|
23 |
+
mimetypes.add_type("image/webp", ".webp", True)
|
24 |
+
mimetypes.add_type("document/html", ".html", True)
|
25 |
+
mimetypes.add_type("document/html", ".htm", True)
|
26 |
+
mimetypes.add_type("application/json", ".json", True)
|
27 |
+
mimetypes.add_type("application/xml", ".xml", True)
|
28 |
+
|
29 |
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
30 |
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
31 |
+
|
32 |
+
|
33 |
+
# Quick-start development settings - unsuitable for production
|
34 |
+
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
35 |
+
|
36 |
+
# SECURITY WARNING: keep the secret key used in production secret!
|
37 |
+
SECRET_KEY = "django-insecure-qx!bso^+a%d!fuu9ti6i_)^hv(1iunmkha9le#4(%y$6v3vzrf"
|
38 |
+
|
39 |
+
# SECURITY WARNING: don't run with debug turned on in production!
|
40 |
+
DEBUG = True
|
41 |
+
|
42 |
+
ALLOWED_HOSTS = ["*","thejagstudio-voiceassist.hf.space"]
|
43 |
+
|
44 |
+
CORS_ORIGIN_ALLOW_ALL = True
|
45 |
+
|
46 |
+
REACT_APP_BUILD_PATH = "vafront/dist"
|
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 |
+
"corsheaders",
|
59 |
+
"react",
|
60 |
+
"api",
|
61 |
+
"import_export"
|
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 = "voiceassist.urls"
|
76 |
+
SETTINGS_PATH = Path(__file__).resolve().parent.parent
|
77 |
+
TEMPLATE_DIRS = (
|
78 |
+
os.path.join(SETTINGS_PATH, 'vafront\\dist'),
|
79 |
+
"templates"
|
80 |
+
)
|
81 |
+
TEMPLATES = [
|
82 |
+
{
|
83 |
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
84 |
+
"DIRS": TEMPLATE_DIRS,
|
85 |
+
"APP_DIRS": True,
|
86 |
+
"OPTIONS": {
|
87 |
+
"context_processors": [
|
88 |
+
"django.template.context_processors.debug",
|
89 |
+
"django.template.context_processors.request",
|
90 |
+
"django.contrib.auth.context_processors.auth",
|
91 |
+
"django.contrib.messages.context_processors.messages",
|
92 |
+
],
|
93 |
+
},
|
94 |
+
},
|
95 |
+
]
|
96 |
+
|
97 |
+
WSGI_APPLICATION = "voiceassist.wsgi.application"
|
98 |
+
|
99 |
+
|
100 |
+
# Database
|
101 |
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
102 |
+
|
103 |
+
# "default": {
|
104 |
+
# "ENGINE": "django.db.backends.sqlite3",
|
105 |
+
# "NAME": str(BASE_DIR / "db.sqlite3"),
|
106 |
+
# }
|
107 |
+
DATABASES = {
|
108 |
+
"default": {
|
109 |
+
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
110 |
+
'NAME': 'postgres',
|
111 |
+
'USER': 'postgres.vwsicmdxnmlqrrpqvpqk',
|
112 |
+
'PASSWORD': 'nsEaNAJyzOQsLxgM',
|
113 |
+
'HOST': 'aws-0-us-east-1.pooler.supabase.com',
|
114 |
+
'PORT': '6543',
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
# Password validation
|
120 |
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
121 |
+
|
122 |
+
AUTH_PASSWORD_VALIDATORS = [
|
123 |
+
{
|
124 |
+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
125 |
+
},
|
126 |
+
{
|
127 |
+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
128 |
+
},
|
129 |
+
{
|
130 |
+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
131 |
+
},
|
132 |
+
{
|
133 |
+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
134 |
+
},
|
135 |
+
]
|
136 |
+
|
137 |
+
|
138 |
+
# Internationalization
|
139 |
+
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
140 |
+
|
141 |
+
LANGUAGE_CODE = "en-us"
|
142 |
+
|
143 |
+
TIME_ZONE = "UTC"
|
144 |
+
|
145 |
+
USE_I18N = True
|
146 |
+
|
147 |
+
USE_TZ = True
|
148 |
+
|
149 |
+
|
150 |
+
# Static files (CSS, JavaScript, Images)
|
151 |
+
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
152 |
+
|
153 |
+
STATIC_URL = "static/"
|
154 |
+
STATIC_DIR = ["/static/", BASE_DIR / REACT_APP_BUILD_PATH]
|
155 |
+
STATIC_ROOT = BASE_DIR / "static"
|
156 |
+
MEDIA_ROOT = BASE_DIR / "media"
|
157 |
+
MEDIA_URL = "/media/"
|
158 |
+
|
159 |
+
# Default primary key field type
|
160 |
+
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
161 |
+
|
162 |
+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|