2Django settings for back2fa project.
4Generated by 'django-admin startproject' using Django 4.2.
6For more information on this file, see
7https://docs.djangoproject.com/en/4.2/topics/settings/
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/4.2/ref/settings/
13from pathlib
import Path
17BASE_DIR = Path(__file__).resolve().parent.parent
24SECRET_KEY = os.environ.get(
'DJANGO_SECRET_KEY',
'django-insecure-qhu0i@1blx*kwq=!o#grkdq^_5k1gce3(8(y46twjd40_vcj$$')
27DEBUG = os.environ.get(
'DJANGO_DEBUG',
'False') !=
'False'
29ALLOWED_HOSTS = [
'back2fa.onrender.com',
'localhost',
'127.0.0.1']
32SECURE_SSL_REDIRECT = os.environ.get(
'DJANGO_SECURE_SSL_REDIRECT',
'False') ==
'True'
33SECURE_HSTS_SECONDS = 3600
34SECURE_HSTS_INCLUDE_SUBDOMAINS =
True
35SECURE_HSTS_PRELOAD =
True
36SESSION_COOKIE_SECURE =
True
37CSRF_COOKIE_SECURE =
True
38SECURE_BROWSER_XSS_FILTER =
True
39SECURE_CONTENT_TYPE_NOSNIFF =
True
40X_FRAME_OPTIONS =
'DENY'
41SECURE_PROXY_SSL_HEADER = (
'HTTP_X_FORWARDED_PROTO',
'https')
47 'django.contrib.admin',
48 'django.contrib.auth',
49 'django.contrib.contenttypes',
50 'django.contrib.sessions',
51 'django.contrib.messages',
52 'django.contrib.staticfiles',
57INSTALLED_APPS += [
'corsheaders']
60 'corsheaders.middleware.CorsMiddleware',
61 'django.middleware.security.SecurityMiddleware',
62 'django.contrib.sessions.middleware.SessionMiddleware',
63 'django.middleware.common.CommonMiddleware',
64 'django.middleware.csrf.CsrfViewMiddleware',
65 'django.contrib.auth.middleware.AuthenticationMiddleware',
66 'django.contrib.messages.middleware.MessageMiddleware',
67 'django.middleware.clickjacking.XFrameOptionsMiddleware',
70ROOT_URLCONF =
'back2fa.urls'
74 'BACKEND':
'django.template.backends.django.DjangoTemplates',
78 'context_processors': [
79 'django.template.context_processors.debug',
80 'django.template.context_processors.request',
81 'django.contrib.auth.context_processors.auth',
82 'django.contrib.messages.context_processors.messages',
88WSGI_APPLICATION =
'back2fa.wsgi.application'
96 'ENGINE':
'django.db.backends.mysql',
99 'PASSWORD':
'BGVqserZKnEpylRlbhwyQcgSmmoocqAt',
100 'HOST':
'shortline.proxy.rlwy.net',
103 'sql_mode':
'traditional',
112AUTH_PASSWORD_VALIDATORS = [
114 'NAME':
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
117 'NAME':
'django.contrib.auth.password_validation.MinimumLengthValidator',
120 'NAME':
'django.contrib.auth.password_validation.CommonPasswordValidator',
123 'NAME':
'django.contrib.auth.password_validation.NumericPasswordValidator',
131LANGUAGE_CODE =
'en-us'
143STATIC_URL =
'/static/'
144STATIC_ROOT = os.path.join(BASE_DIR,
'staticfiles')
149DEFAULT_AUTO_FIELD =
'django.db.models.BigAutoField'
151CORS_ALLOWED_ORIGINS = [
152 "https://ispcfood.netlify.app",
153 "http://localhost:4200",
154 "http://localhost:4000",
155 "http://127.0.0.1:4200",
156 "https://ispcfood.netlify.app",
157 "https://*.netlify.app",
162CORS_ALLOW_ALL_ORIGINS =
False
163CORS_ALLOW_CREDENTIALS =
True
164CORS_ALLOW_METHODS = [
172CORS_ALLOW_HEADERS = [
187 'disable_existing_loggers':
False,
190 'class':
'logging.StreamHandler',
194 'handlers': [
'console'],
199 'handlers': [
'console'],