|
@@ -1,372 +0,0 @@
|
|
|
-import os
|
|
|
-
|
|
|
-from pathlib import Path
|
|
|
-
|
|
|
-from django.contrib.messages import constants as message_constants
|
|
|
-
|
|
|
-
|
|
|
-class ConfigDjango:
|
|
|
-
|
|
|
- BASE_DIR = Path(__file__).resolve().parent.parent
|
|
|
-
|
|
|
-
|
|
|
- SECRET_KEY = 'django-insecure-$eodx2ilnb*djkahfguiwegbwelgbnajl*u$qkt7j-b)7t1iq'
|
|
|
-
|
|
|
- DEBUG = True
|
|
|
- CSRF_TRUSTED_ORIGINS = []
|
|
|
- ALLOWED_HOSTS = ["127.0.0.1"]
|
|
|
- INTERNAL_IPS = ["127.0.0.1"]
|
|
|
-
|
|
|
-
|
|
|
- INSTALLED_APPS = [
|
|
|
- 'jazzmin',
|
|
|
- 'django.contrib.admin',
|
|
|
- 'django.contrib.auth',
|
|
|
- 'django.contrib.contenttypes',
|
|
|
- 'django.contrib.sessions',
|
|
|
- 'django.contrib.messages',
|
|
|
- 'django.contrib.staticfiles',
|
|
|
- 'SharixAdmin.apps.SharixadminConfig',
|
|
|
- 'tickets.apps.TicketsConfig',
|
|
|
- 'metaservicesynced.apps.MetaservicesyncedConfig',
|
|
|
- 'django_tables2',
|
|
|
- "django.contrib.sites",
|
|
|
- "django.contrib.flatpages",
|
|
|
- "django.contrib.admindocs",
|
|
|
- "django_extensions",
|
|
|
- 'rest_framework',
|
|
|
- 'rest_framework.authtoken',
|
|
|
- 'djoser',
|
|
|
- 'schema_graph',
|
|
|
- 'drf_yasg',
|
|
|
- 'django_spaghetti',
|
|
|
- 'debug_toolbar',
|
|
|
- ]
|
|
|
-
|
|
|
- MIDDLEWARE = [
|
|
|
- 'django.middleware.security.SecurityMiddleware',
|
|
|
- 'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
- 'django.middleware.common.CommonMiddleware',
|
|
|
- 'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
- 'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
- 'django.contrib.admindocs.middleware.XViewMiddleware',
|
|
|
- "debug_toolbar.middleware.DebugToolbarMiddleware",
|
|
|
- ]
|
|
|
-
|
|
|
- ROOT_URLCONF = "core.urls"
|
|
|
-
|
|
|
- SESSION_EXPIRE_AT_BROWSER_CLOSE = False
|
|
|
- SESSION_SECURITY_WARN_AFTER = 5
|
|
|
- SESSION_SECURITY_EXPIRE_AFTER = 12
|
|
|
-
|
|
|
- TEMPLATES = [
|
|
|
- {
|
|
|
- "BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
|
- "DIRS": [os.path.join(BASE_DIR, "templates")],
|
|
|
- "APP_DIRS": True,
|
|
|
- "OPTIONS": {
|
|
|
- "context_processors": [
|
|
|
- "django.template.context_processors.debug",
|
|
|
- "django.template.context_processors.request",
|
|
|
- "django.contrib.auth.context_processors.auth",
|
|
|
- "django.template.context_processors.i18n",
|
|
|
- "django.template.context_processors.media",
|
|
|
- "django.template.context_processors.static",
|
|
|
- "django.template.context_processors.tz",
|
|
|
- "django.contrib.messages.context_processors.messages",
|
|
|
- ],
|
|
|
- },
|
|
|
- }
|
|
|
- ]
|
|
|
-
|
|
|
- WSGI_APPLICATION = 'core.wsgi.application'
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- DATABASES = {
|
|
|
- 'default': {
|
|
|
- 'ENGINE': 'django.db.backends.sqlite3',
|
|
|
- 'NAME': BASE_DIR / 'db.sqlite3',
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- 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'
|
|
|
- USE_TZ = True
|
|
|
- TIME_ZONE = 'Europe/Moscow'
|
|
|
- SITE_ID = 1
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- USE_I18N = True
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- STATIC_URL = "/static/"
|
|
|
- STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
|
|
|
-
|
|
|
-
|
|
|
- MEDIA_URL = "/media/"
|
|
|
- MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
|
|
-
|
|
|
-
|
|
|
- FILE_UPLOAD_PERMISSIONS = 0o644
|
|
|
-
|
|
|
-
|
|
|
- MESSAGE_TAGS = {message_constants.ERROR: "danger"}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
|
-
|
|
|
- AUTH_USER_MODEL = 'SharixAdmin.SharixUser'
|
|
|
-
|
|
|
-
|
|
|
-class ConfigJazzmin:
|
|
|
- JAZZMIN_SETTINGS = {
|
|
|
-
|
|
|
- "site_title": "ShariX Admin",
|
|
|
-
|
|
|
-
|
|
|
- "site_header": "ShariX Platform",
|
|
|
-
|
|
|
-
|
|
|
- "site_brand": "ShariX Platform",
|
|
|
-
|
|
|
-
|
|
|
- "site_logo": "SharixAdmin/img/logo.svg",
|
|
|
-
|
|
|
-
|
|
|
- "login_logo": None,
|
|
|
-
|
|
|
-
|
|
|
- "login_logo_dark": None,
|
|
|
-
|
|
|
-
|
|
|
- "site_logo_classes": "img-circle",
|
|
|
-
|
|
|
-
|
|
|
- "site_icon": None,
|
|
|
-
|
|
|
-
|
|
|
- "welcome_sign": "Welcome to the ShariX Admin",
|
|
|
-
|
|
|
-
|
|
|
- "copyright": "Acme Library Ltd",
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- "search_model": ["SharixAdmin.SharixUser"],
|
|
|
-
|
|
|
-
|
|
|
- "user_avatar": "",
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- "topmenu_links": [
|
|
|
-
|
|
|
-
|
|
|
- {"name": "Главная", "url": "admin:index", "permissions": ["auth.view_user"]},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- {"model": "SharixAdmin.SharixUser"},
|
|
|
-
|
|
|
-
|
|
|
- {"app": "tickets"},
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- "icons": {
|
|
|
- "auth": "fas fa-users-cog",
|
|
|
- "auth.user": "fas fa-user",
|
|
|
- "auth.Group": "fas fa-users",
|
|
|
- "SharixAdmin": "fas fa-users-cog",
|
|
|
- "SharixAdmin.SharixUser": "fas fa-user",
|
|
|
- "tickets.Task": "fas fa-check",
|
|
|
- "tickets.TaskList": "fas fa-list",
|
|
|
- "tickets.Comment": "fas fa-comment",
|
|
|
- "tickets.Attachment": "fas fa-file",
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- "custom_css": None,
|
|
|
- "custom_js": None,
|
|
|
-
|
|
|
- "use_google_fonts_cdn": True,
|
|
|
-
|
|
|
- "show_ui_builder": True,
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- JAZZMIN_UI_TWEAKS = {
|
|
|
- "navbar_small_text": True,
|
|
|
- "footer_small_text": True,
|
|
|
- "body_small_text": False,
|
|
|
- "brand_small_text": True,
|
|
|
- "brand_colour": "navbar-light",
|
|
|
- "accent": "accent-navy",
|
|
|
- "navbar": "navbar-navy navbar-dark",
|
|
|
- "no_navbar_border": False,
|
|
|
- "navbar_fixed": False,
|
|
|
- "layout_boxed": False,
|
|
|
- "footer_fixed": False,
|
|
|
- "sidebar_fixed": True,
|
|
|
- "sidebar": "sidebar-light-navy",
|
|
|
- "sidebar_nav_small_text": False,
|
|
|
- "sidebar_disable_expand": False,
|
|
|
- "sidebar_nav_child_indent": False,
|
|
|
- "sidebar_nav_compact_style": True,
|
|
|
- "sidebar_nav_legacy_style": False,
|
|
|
- "sidebar_nav_flat_style": False,
|
|
|
- "theme": "default",
|
|
|
- "dark_mode_theme": None,
|
|
|
- "button_classes": {
|
|
|
- "primary": "btn-outline-primary",
|
|
|
- "secondary": "btn-outline-secondary",
|
|
|
- "info": "btn-outline-info",
|
|
|
- "warning": "btn-outline-warning",
|
|
|
- "danger": "btn-outline-danger",
|
|
|
- "success": "btn-outline-success"
|
|
|
- },
|
|
|
- "actions_sticky_top": False
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-class ConfigAPI:
|
|
|
- REST_FRAMEWORK = {
|
|
|
-
|
|
|
-
|
|
|
- 'DEFAULT_RENDERER_CLASSES':[
|
|
|
- 'rest_framework.renderers.JSONRenderer',
|
|
|
- 'rest_framework.renderers.BrowsableAPIRenderer',
|
|
|
- ],
|
|
|
- 'DEFAULT_PERMISSION_CLASSES': [
|
|
|
-
|
|
|
-
|
|
|
- ],
|
|
|
- 'DEFAULT_AUTHENTICATION_CLASSES': (
|
|
|
- 'rest_framework.authentication.TokenAuthentication',
|
|
|
- 'rest_framework.authentication.BasicAuthentication',
|
|
|
- 'rest_framework.authentication.SessionAuthentication',
|
|
|
- ),
|
|
|
- }
|
|
|
-
|
|
|
- SPAGHETTI_SAUCE = {
|
|
|
- 'apps': ['auth', 'SharixAdmin',
|
|
|
- 'tickets', 'admin',
|
|
|
- 'flatpages', 'sessions', 'sites', 'metaservicesynced'],
|
|
|
- 'show_fields': False,
|
|
|
- 'show_proxy':True,
|
|
|
- }
|
|
|
-
|
|
|
- GRAPH_MODELS = {
|
|
|
- 'all_applications': True,
|
|
|
- 'group_models': True,
|
|
|
- }
|
|
|
-
|
|
|
- DJOSER = {
|
|
|
- 'SERIALIZERS': {
|
|
|
- 'token': 'SharixAdmin.api.serializers.CustomTokenSerializer',
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-class ConfigGunicorn:
|
|
|
- bind = "127.0.0.1:8000"
|
|
|
- workers = 2
|
|
|
- worker_class = "sync"
|
|
|
- threads = 4
|
|
|
- timeout = 30
|
|
|
- max_requests = 1000
|
|
|
- capture_output = True
|