Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf-8
- from .redis_pass import REDIS_PASSWD
- import os
- import datetime
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- ASGI_APPLICATION = 'Doctor_at_home_team.routing.application'
- # Quick-start development settings - unsuitable for production
- # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
- # SECURITY WARNING: keep the secret key used in production secret!
- SECRET_KEY = '9u^j-ex$@8ph2d#plq1nvzw@sf#&s#ul*5%w*vhe^-a%-4cl=)'
- SECRET_KEY_AUTO_DAIL = '8TqIdnlP6NO35oF38Su1VgeJZYTDTpd7x5gZ'
- # SECURITY WARNING: don't run with debug turned on in production!
- DEBUG = True
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- ALLOWED_HOSTS = ['*']
- # Application definition
- INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'ckeditor',
- 'channels',
- 'ckeditor_uploader',
- 'trekking',
- 'remote_connection',
- 'djoser',
- 'rest_framework',
- 'registration',
- 'dal',
- 'dal_select2',
- 'rest_framework_json_api',
- 'rest_framework_jwt',
- 'django_filters',
- 'rest_framework.authtoken',
- 'rest_api',
- 'account',
- 'netpay',
- 'sslserver', # only for dev
- 'fontawesome-free',
- # 'silk' #SILK
- 'medicalaccount',
- ]
- MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.common.CommonMiddleware',
- # 'silk.middleware.SilkyMiddleware', # SILK
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- ]
- ROOT_URLCONF = 'Doctor_at_home_team.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, 'templates_team')],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- ],
- },
- },
- ]
- WSGI_APPLICATION = 'Doctor_at_home_team.wsgi.application'
- # Database
- # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': 'new_elena',
- 'HOST': '176.124.136.6',
- 'PORT': '5432',
- 'USER': 'elena',
- 'PASSWORD': 'tktyf!@#4'
- },
- }
- AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
- ]
- LANGUAGE_CODE = 'ru-ru'
- TIME_ZONE = 'Europe/Moscow'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = False
- STATIC_URL = '/static_team/'
- STATIC_ROOT = os.path.join(BASE_DIR, 'static_team/')
- EMAIL_HOST = "smtp.gmail.com"
- EMAIL_PORT = 587
- EMAIL_HOST_USER = "noc@globalhome.su"
- EMAIL_HOST_PASSWORD = "yjr!@#"
- EMAIL_USE_TLS = True
- SERVER_EMAIL = EMAIL_HOST_USER
- DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
- STATICFILES_DIRS = [
- os.path.join(BASE_DIR, "Doctor_at_home_team/static_team"),
- ]
- AUTHENTICATION_BACKENDS = [
- "django.contrib.auth.backends.ModelBackend",
- "registration.authentication.EmailAuthBackend",
- ]
- REDIS_HOST = '127.0.0.1'
- REDIS_PORT = 6379
- CHANNEL_LAYERS = {
- 'default': {
- 'BACKEND': 'channels_redis.core.RedisChannelLayer',
- 'CONFIG': {
- # "hosts": [(REDIS_HOST, REDIS_PORT)],
- "hosts": ["redis://:%s@%s:%s" % (REDIS_PASSWD, REDIS_HOST, REDIS_PORT)],
- },
- },
- }
- MEDIA_URL = "/media/"
- MEDIA_ROOT = os.path.join(BASE_DIR, "media")
- CKEDITOR_UPLOAD_PATH = "uploads/"
- LOGIN_REDIRECT_URL = "/"
- SECRET_KEY = "rujohf9472" # Секретный ключ для api 2 gis
- REST_FRAMEWORK = {
- "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.AllowAny",),
- "PAGE_SIZE": 10,
- "DEFAULT_AUTHENTICATION_CLASSES": (
- "rest_framework_jwt.authentication.JSONWebTokenAuthentication",
- "rest_framework.authentication.TokenAuthentication",
- "rest_framework_simplejwt.authentication.JWTAuthentication",
- "rest_framework.authentication.BasicAuthentication",
- "rest_framework.authentication.SessionAuthentication",
- ),
- "DEFAULT_PAGINATION_CLASS": "rest_framework_json_api.pagination.PageNumberPagination",
- "TEST_REQUEST_DEFAULT_FORMAT": "json",
- "DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend"],
- "DATETIME_FORMAT": "%d.%m.%Y %H:%M:%S",
- }
- JWT_AUTH = {
- "JWT_EXPIRATION_DELTA": datetime.timedelta(days=2),
- "JWT_ALLOW_REFRESH": True,
- "JWT_REFRESH_EXPIRATION_DELTA": datetime.timedelta(days=7), # default
- }
- DJOSER = {
- "PASSWORD_RESET_CONFIRM_URL": "#/password/reset/confirm/{uid}/{token}",
- "USERNAME_RESET_CONFIRM_URL": "#/username/reset/confirm/{uid}/{token}",
- "ACTIVATION_URL": "#/activate/{uid}/{token}",
- "SEND_ACTIVATION_EMAIL": True,
- "SERIALIZERS": {},
- }
- SIMPLE_JWT = {
- "ACCESS_TOKEN_LIFETIME": datetime.timedelta(minutes=5),
- "REFRESH_TOKEN_LIFETIME": datetime.timedelta(days=1),
- "ROTATE_REFRESH_TOKENS": False,
- "BLACKLIST_AFTER_ROTATION": True,
- "ALGORITHM": "HS256",
- "SIGNING_KEY": SECRET_KEY,
- "VERIFYING_KEY": None,
- "AUDIENCE": None,
- "ISSUER": None,
- "AUTH_HEADER_TYPES": ("JWT",),
- "USER_ID_FIELD": "id",
- "USER_ID_CLAIM": "user_id",
- "AUTH_TOKEN_CLASSES": ("rest_framework_simplejwt.tokens.AccessToken",),
- "TOKEN_TYPE_CLAIM": "token_type",
- "JTI_CLAIM": "jti",
- "SLIDING_TOKEN_REFRESH_EXP_CLAIM": "refresh_exp",
- "SLIDING_TOKEN_LIFETIME": datetime.timedelta(minutes=5),
- "SLIDING_TOKEN_REFRESH_LIFETIME": datetime.timedelta(days=1),
- }
- EMERGENCY_PHONES = {
- # '846': '78463077707',
- "499": "74996383003",
- "846": "78486250099",
- "999": "79992332322",
- }
- CACHES = {
- "default": {
- "BACKEND": "django_redis.cache.RedisCache",
- # "redis://127.0.0.1:6379",
- "LOCATION": "redis://:%s@%s:%s" % (REDIS_PASSWD, REDIS_HOST, REDIS_PORT),
- "OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient"}
- }
- }
- # 'redis://127.0.0.1:6379'
- CELERY_BROKER_URL = "redis://:%s@%s:%s" % (
- REDIS_PASSWD, REDIS_HOST, REDIS_PORT)
- # "redis://127.0.0.1:6379"
- CELERY_RESULT_BACKEND = "redis://:%s@%s:%s" % (
- REDIS_PASSWD, REDIS_HOST, REDIS_PORT)
- CELERY_TIMEZONE = 'UTC'
- CELERY_TASK_TRACK_STARTED = True
- # LOGGING = {
- # 'version': 1,
- # 'disable_existing_loggers': False,
- # 'handlers': {
- # 'console': {
- # 'class': 'logging.StreamHandler',
- # },
- # },
- # 'loggers': {
- # 'django.db.backends': {
- # 'level': 'DEBUG',
- # 'handlers': ['console'],
- # }
- # },
- # }
- LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'formatters': {
- 'verbose': {
- 'format': '%(levelname)s - [%(asctime)s] - %(name)s.%(funcName)s:%(lineno)s - %(message)s'
- }
- },
- 'handlers': {
- 'console': {
- 'class': 'logging.StreamHandler',
- 'level': 'DEBUG',
- 'formatter': 'verbose',
- },
- },
- 'loggers': {
- 'apps': {
- 'handlers': ['console'],
- 'level': 'DEBUG',
- 'propagate': False,
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement