settings.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. """
  2. Django settings for filmbase project.
  3. Generated by 'django-admin startproject' using Django 5.1.3.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/5.1/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/5.1/ref/settings/
  8. """
  9. from pathlib import Path
  10. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  11. BASE_DIR = Path(__file__).resolve().parent.parent
  12. # Quick-start development settings - unsuitable for production
  13. # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
  14. # SECURITY WARNING: keep the secret key used in production secret!
  15. SECRET_KEY = 'django-insecure-oxnm+r_5an@uc6rwn5vz'\
  16. '=k954e*01247lvck-=9@aq2d9lg18x'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = []
  20. # Application definition
  21. INSTALLED_APPS = [
  22. 'signup.apps.SignupConfig',
  23. 'dal',
  24. 'dal_select2',
  25. "django_bootstrap5",
  26. 'django.contrib.admin',
  27. 'django.contrib.auth',
  28. 'django.contrib.contenttypes',
  29. 'django.contrib.sessions',
  30. 'django.contrib.messages',
  31. 'django.contrib.staticfiles',
  32. 'films.apps.FilmsConfig',
  33. ]
  34. MIDDLEWARE = [
  35. 'django.middleware.security.SecurityMiddleware',
  36. 'django.contrib.sessions.middleware.SessionMiddleware',
  37. 'django.middleware.common.CommonMiddleware',
  38. 'django.middleware.csrf.CsrfViewMiddleware',
  39. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  40. 'django.contrib.messages.middleware.MessageMiddleware',
  41. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  42. ]
  43. ROOT_URLCONF = 'filmbase.urls'
  44. TEMPLATES = [
  45. {
  46. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  47. 'DIRS': [],
  48. 'APP_DIRS': True,
  49. 'OPTIONS': {
  50. 'context_processors': [
  51. 'django.template.context_processors.debug',
  52. 'django.template.context_processors.request',
  53. 'django.contrib.auth.context_processors.auth',
  54. 'django.contrib.messages.context_processors.messages',
  55. ],
  56. },
  57. },
  58. ]
  59. WSGI_APPLICATION = 'filmbase.wsgi.application'
  60. # Database
  61. # https://docs.djangoproject.com/en/5.1/ref/settings/#databases
  62. DATABASES = {
  63. 'default': {
  64. 'ENGINE': 'django.db.backends.sqlite3',
  65. 'NAME': BASE_DIR / 'db.sqlite3',
  66. }
  67. }
  68. # Password validation
  69. # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
  70. AUTH_PASSWORD_VALIDATORS = [
  71. {
  72. 'NAME': 'django.contrib.auth.password_validation'
  73. '.UserAttributeSimilarityValidator',
  74. },
  75. {
  76. 'NAME': 'django.contrib.auth.password_validation'
  77. '.MinimumLengthValidator',
  78. },
  79. {
  80. 'NAME': 'django.contrib.auth.password_validation'
  81. '.CommonPasswordValidator',
  82. },
  83. {
  84. 'NAME': 'django.contrib.auth.password_validation'
  85. '.NumericPasswordValidator',
  86. },
  87. ]
  88. # Internationalization
  89. # https://docs.djangoproject.com/en/5.1/topics/i18n/
  90. LANGUAGE_CODE = 'ru'
  91. TIME_ZONE = 'Europe/Moscow'
  92. USE_I18N = True
  93. USE_TZ = True
  94. # Static files (CSS, JavaScript, Images)
  95. # https://docs.djangoproject.com/en/5.1/howto/static-files/
  96. STATIC_URL = 'static/'
  97. # Default primary key field type
  98. # https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
  99. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  100. LOGIN_REDIRECT_URL = 'films:home'
  101. MEDIA_URL = 'media/'
  102. MEDIA_ROOT = BASE_DIR / 'media'