notification: add firebase notification to web
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
from datetime import timedelta
|
||||
from pathlib import Path
|
||||
|
||||
from config.conf.celery import *
|
||||
from config.conf.cors_headers import *
|
||||
from config.conf.drf_yasg import *
|
||||
from config.conf.jazzmin import *
|
||||
from config.conf.logs import *
|
||||
from config.conf.redis import *
|
||||
from config.conf.rest_framework import *
|
||||
from config.conf.rest_framework_simplejwt import *
|
||||
from config.env import env
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
@@ -11,95 +19,95 @@ BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = env.str('SECRET_KEY')
|
||||
SECRET_KEY = env.str("SECRET_KEY")
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = env.bool('DEBUG')
|
||||
DEBUG = env.bool("DEBUG")
|
||||
|
||||
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
|
||||
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")
|
||||
|
||||
|
||||
# Application definition
|
||||
APPS = [
|
||||
'core.apps.accounts',
|
||||
'core.apps.shared',
|
||||
'core.apps.company',
|
||||
'core.apps.wherehouse',
|
||||
'core.apps.products',
|
||||
'core.apps.projects',
|
||||
'core.apps.orders',
|
||||
'core.apps.finance',
|
||||
'core.apps.counterparty',
|
||||
'core.apps.notifications',
|
||||
"core.apps.accounts",
|
||||
"core.apps.shared",
|
||||
"core.apps.company",
|
||||
"core.apps.wherehouse",
|
||||
"core.apps.products",
|
||||
"core.apps.projects",
|
||||
"core.apps.orders",
|
||||
"core.apps.finance",
|
||||
"core.apps.counterparty",
|
||||
"core.apps.notifications",
|
||||
]
|
||||
|
||||
PACKAGES = [
|
||||
'drf_yasg',
|
||||
'rest_framework',
|
||||
'rest_framework_simplejwt',
|
||||
'corsheaders',
|
||||
'cacheops',
|
||||
"drf_yasg",
|
||||
"rest_framework",
|
||||
"rest_framework_simplejwt",
|
||||
"corsheaders",
|
||||
"cacheops",
|
||||
]
|
||||
|
||||
DJANGO_APPS = [
|
||||
'jazzmin',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
"jazzmin",
|
||||
"django.contrib.admin",
|
||||
"django.contrib.auth",
|
||||
"django.contrib.contenttypes",
|
||||
"django.contrib.sessions",
|
||||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
]
|
||||
|
||||
INSTALLED_APPS = []
|
||||
INSTALLED_APPS += DJANGO_APPS
|
||||
INSTALLED_APPS += PACKAGES
|
||||
INSTALLED_APPS += PACKAGES
|
||||
INSTALLED_APPS += APPS
|
||||
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'corsheaders.middleware.CorsMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"corsheaders.middleware.CorsMiddleware",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
"django.middleware.csrf.CsrfViewMiddleware",
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
# 'silk.middleware.SilkyMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'config.urls'
|
||||
ROOT_URLCONF = "config.urls"
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [],
|
||||
"APP_DIRS": True,
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = 'config.wsgi.application'
|
||||
WSGI_APPLICATION = "config.wsgi.application"
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': env.str('POSTGRES_DB'),
|
||||
'USER': env.str('POSTGRES_USER'),
|
||||
'PASSWORD': env.str('POSTGRES_PASSWORD'),
|
||||
'HOST': env.str('POSTGRES_HOST'),
|
||||
'PORT': env.str('POSTGRES_PORT'),
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql",
|
||||
"NAME": env.str("POSTGRES_DB"),
|
||||
"USER": env.str("POSTGRES_USER"),
|
||||
"PASSWORD": env.str("POSTGRES_PASSWORD"),
|
||||
"HOST": env.str("POSTGRES_HOST"),
|
||||
"PORT": env.str("POSTGRES_PORT"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,16 +117,16 @@ DATABASES = {
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
||||
},
|
||||
]
|
||||
|
||||
@@ -126,9 +134,9 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/5.2/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'uz'
|
||||
LANGUAGE_CODE = "uz"
|
||||
|
||||
TIME_ZONE = 'Asia/Tashkent'
|
||||
TIME_ZONE = "Asia/Tashkent"
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
@@ -138,25 +146,21 @@ USE_TZ = False
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/5.2/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATIC_ROOT = BASE_DIR / 'resources/static'
|
||||
MEDIA_URL = 'media/'
|
||||
MEDIA_ROOT = BASE_DIR / 'resources/media'
|
||||
STATIC_URL = "static/"
|
||||
STATIC_ROOT = BASE_DIR / "resources/static"
|
||||
MEDIA_URL = "media/"
|
||||
MEDIA_ROOT = BASE_DIR / "resources/media"
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
|
||||
AUTH_USER_MODEL = 'accounts.User'
|
||||
AUTH_USER_MODEL = "accounts.User"
|
||||
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', env.str("SWAGGER_PROTOCOL", 'https'))
|
||||
SECURE_PROXY_SSL_HEADER = (
|
||||
"HTTP_X_FORWARDED_PROTO",
|
||||
env.str("SWAGGER_PROTOCOL", "https"),
|
||||
)
|
||||
|
||||
from config.conf.rest_framework import *
|
||||
from config.conf.rest_framework_simplejwt import *
|
||||
from config.conf.logs import *
|
||||
from config.conf.cors_headers import *
|
||||
from config.conf.drf_yasg import *
|
||||
from config.conf.jazzmin import *
|
||||
from config.conf.celery import *
|
||||
from config.conf.redis import *
|
||||
FCM_SERVER_KEY = env.str("FCM_SERVER_KEY")
|
||||
|
||||
Reference in New Issue
Block a user