settings.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. from pathlib import Path
  2. import os
  3. from core.db_settings import *
  4. from core.api_settings import *
  5. from core.todo_mail_settings import *
  6. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  7. BASE_DIR = Path(__file__).resolve().parent.parent
  8. # SECURITY WARNING: keep the secret key used in production secret!
  9. SECRET_KEY = 'django-insecure-t064c*-&=sq48kon3()$mge6cos*#x%*c$dr#1*n*+b$s6fw=*'
  10. # SECURITY WARNING: don't run with debug turned on in production!
  11. DEBUG = True
  12. ALLOWED_HOSTS = []
  13. CSRF_TRUSTED_ORIGINS = []
  14. # Application definition
  15. INSTALLED_APPS = [
  16. 'django.contrib.admin',
  17. 'django.contrib.auth',
  18. 'django.contrib.contenttypes',
  19. 'django.contrib.sessions',
  20. 'django.contrib.messages',
  21. 'django.contrib.staticfiles',
  22. 'SharixAdmin.apps.SharixadminConfig',
  23. 'todo.apps.TodoConfig',
  24. 'django_tables2',
  25. "django.contrib.sites",
  26. "django.contrib.flatpages",
  27. "django.contrib.admindocs",
  28. "django_extensions",
  29. 'rest_framework',
  30. 'rest_framework.authtoken',
  31. 'djoser',
  32. 'schema_graph',
  33. 'django_spaghetti',
  34. ]
  35. MIDDLEWARE = [
  36. 'django.middleware.security.SecurityMiddleware',
  37. 'django.contrib.sessions.middleware.SessionMiddleware',
  38. 'django.middleware.common.CommonMiddleware',
  39. 'django.middleware.csrf.CsrfViewMiddleware',
  40. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  41. 'django.contrib.messages.middleware.MessageMiddleware',
  42. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  43. ]
  44. ROOT_URLCONF = 'core.urls'
  45. #SESSION_EXPIRE_AT_BROWSER_CLOSE = True
  46. #SESSION_SECURITY_WARN_AFTER = 5
  47. #SESSION_SECURITY_EXPIRE_AFTER = 12
  48. INTERNAL_IPS = [
  49. '127.0.0.1',
  50. ]
  51. TEMPLATES = [
  52. {
  53. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  54. 'DIRS': [],
  55. 'APP_DIRS': True,
  56. 'OPTIONS': {
  57. 'context_processors': [
  58. 'django.template.context_processors.debug',
  59. 'django.template.context_processors.request',
  60. 'django.contrib.auth.context_processors.auth',
  61. 'django.contrib.messages.context_processors.messages',
  62. "django.template.context_processors.i18n",
  63. "django.template.context_processors.media",
  64. "django.template.context_processors.static",
  65. "django.template.context_processors.tz",
  66. ],
  67. 'libraries': {
  68. 'custom_tags':'todo.template_tags.custom_tags'
  69. }
  70. },
  71. },
  72. ]
  73. WSGI_APPLICATION = 'core.wsgi.application'
  74. # Password validation
  75. # https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
  76. AUTH_PASSWORD_VALIDATORS = [
  77. {
  78. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  79. },
  80. {
  81. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  82. },
  83. {
  84. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  85. },
  86. {
  87. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  88. },
  89. ]
  90. # Internationalization
  91. # https://docs.djangoproject.com/en/4.1/topics/i18n/
  92. LANGUAGE_CODE = 'ru'
  93. TIME_ZONE = 'UTC'
  94. USE_I18N = True
  95. USE_TZ = True
  96. SITE_ID = 1
  97. # Static files (CSS, JavaScript, Images)
  98. # https://docs.djangoproject.com/en/4.1/howto/static-files/
  99. STATIC_URL = '/root/sharix-webuser/SharixAdmin/static/'
  100. STATICFILES_DIRS = [os.path.join(BASE_DIR, "core", "static", "/root/sharix-webuser/SharixAdmin/static/")]
  101. STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
  102. # Uploaded media
  103. MEDIA_ROOT = os.path.join(BASE_DIR, "media")
  104. MEDIA_URL = "/media/"
  105. # Default primary key field type
  106. # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
  107. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  108. AUTH_USER_MODEL = 'SharixAdmin.SharixUser'