|
|
|
@ -1,16 +1,7 @@ |
|
|
|
""" |
|
|
|
import os |
|
|
|
Django settings for tea project. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 4.1.2. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For more information on this file, see |
|
|
|
|
|
|
|
https://docs.djangoproject.com/en/4.1/topics/settings/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For the full list of settings and their values, see |
|
|
|
|
|
|
|
https://docs.djangoproject.com/en/4.1/ref/settings/ |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
import environ |
|
|
|
import environ |
|
|
|
from pathlib import Path |
|
|
|
from django.urls import reverse_lazy |
|
|
|
|
|
|
|
|
|
|
|
env = environ.Env(DEBUG=(bool, False)) |
|
|
|
env = environ.Env(DEBUG=(bool, False)) |
|
|
|
root = environ.Path(__file__) - 2 |
|
|
|
root = environ.Path(__file__) - 2 |
|
|
|
@ -20,10 +11,7 @@ environ.Env.read_env() |
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent |
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production |
|
|
|
|
|
|
|
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret! |
|
|
|
|
|
|
|
SECRET_KEY = env.str('SECRET_KEY', '!!! SET YOUR SECRET_KEY !!!') |
|
|
|
SECRET_KEY = env.str('SECRET_KEY', '!!! SET YOUR SECRET_KEY !!!') |
|
|
|
|
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production! |
|
|
|
# SECURITY WARNING: don't run with debug turned on in production! |
|
|
|
@ -46,7 +34,6 @@ INSTALLED_APPS = [ |
|
|
|
'django.contrib.messages', |
|
|
|
'django.contrib.messages', |
|
|
|
'django.contrib.staticfiles', |
|
|
|
'django.contrib.staticfiles', |
|
|
|
'social_django', |
|
|
|
'social_django', |
|
|
|
'corsheaders', |
|
|
|
|
|
|
|
'choose' |
|
|
|
'choose' |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
@ -54,7 +41,6 @@ MIDDLEWARE = [ |
|
|
|
'django.middleware.security.SecurityMiddleware', |
|
|
|
'django.middleware.security.SecurityMiddleware', |
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware', |
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware', |
|
|
|
'django.middleware.common.CommonMiddleware', |
|
|
|
'django.middleware.common.CommonMiddleware', |
|
|
|
'corsheaders.middleware.CorsMiddleware', |
|
|
|
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware', |
|
|
|
'django.middleware.csrf.CsrfViewMiddleware', |
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
|
|
'django.contrib.messages.middleware.MessageMiddleware', |
|
|
|
'django.contrib.messages.middleware.MessageMiddleware', |
|
|
|
@ -74,6 +60,8 @@ TEMPLATES = [ |
|
|
|
'django.template.context_processors.request', |
|
|
|
'django.template.context_processors.request', |
|
|
|
'django.contrib.auth.context_processors.auth', |
|
|
|
'django.contrib.auth.context_processors.auth', |
|
|
|
'django.contrib.messages.context_processors.messages', |
|
|
|
'django.contrib.messages.context_processors.messages', |
|
|
|
|
|
|
|
'social_django.context_processors.backends', |
|
|
|
|
|
|
|
'social_django.context_processors.login_redirect', |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -136,14 +124,11 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' |
|
|
|
|
|
|
|
|
|
|
|
MEDIA_ROOT = f'{BASE_DIR}/media' |
|
|
|
MEDIA_ROOT = f'{BASE_DIR}/media' |
|
|
|
MEDIA_URL = '/media/' |
|
|
|
MEDIA_URL = '/media/' |
|
|
|
CORS_ORIGIN_WHITELIST = [ |
|
|
|
|
|
|
|
'http://10.15.0.1:8000', |
|
|
|
|
|
|
|
'http://localhost:8000', |
|
|
|
|
|
|
|
'http://127.0.0.1:9000', |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
SOCIAL_AUTH_TELEGRAM_BOT_TOKEN = env.str('SOCIAL_AUTH_TELEGRAM_BOT_TOKEN') |
|
|
|
SOCIAL_AUTH_TELEGRAM_BOT_TOKEN = env.str('SOCIAL_AUTH_TELEGRAM_BOT_TOKEN') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOGIN_REDIRECT_URL = reverse_lazy('home') |
|
|
|
|
|
|
|
|
|
|
|
AUTHENTICATION_BACKENDS = ( |
|
|
|
AUTHENTICATION_BACKENDS = ( |
|
|
|
'social_core.backends.telegram.TelegramAuth', |
|
|
|
'social_core.backends.telegram.TelegramAuth', |
|
|
|
'django.contrib.auth.backends.ModelBackend', |
|
|
|
'django.contrib.auth.backends.ModelBackend', |
|
|
|
|