settings.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. from pathlib import Path
  2. from django.urls import reverse_lazy
  3. BASE_DIR = Path(__file__).resolve().parent.parent
  4. SECRET_KEY = 'django-insecure-yipnj$#j!ajarq%k55z4kuf3x79)91h0h42o9!1ho(z=!%mt=#'
  5. DEBUG = False
  6. ALLOWED_HOSTS = ['*']
  7. INSTALLED_APPS = [
  8. 'django.contrib.admin',
  9. 'django.contrib.auth',
  10. 'django.contrib.contenttypes',
  11. 'django.contrib.sessions',
  12. 'django.contrib.messages',
  13. 'django.contrib.staticfiles',
  14. 'notes.apps.NotesConfig'
  15. ]
  16. MIDDLEWARE = [
  17. 'django.middleware.security.SecurityMiddleware',
  18. 'django.contrib.sessions.middleware.SessionMiddleware',
  19. 'django.middleware.common.CommonMiddleware',
  20. 'django.middleware.csrf.CsrfViewMiddleware',
  21. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  22. 'django.contrib.messages.middleware.MessageMiddleware',
  23. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  24. ]
  25. ROOT_URLCONF = 'yanote.urls'
  26. TEMPLATES = [
  27. {
  28. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  29. 'DIRS': [BASE_DIR / 'templates'],
  30. 'APP_DIRS': True,
  31. 'OPTIONS': {
  32. 'context_processors': [
  33. 'django.template.context_processors.debug',
  34. 'django.template.context_processors.request',
  35. 'django.contrib.auth.context_processors.auth',
  36. 'django.contrib.messages.context_processors.messages',
  37. ],
  38. },
  39. },
  40. ]
  41. WSGI_APPLICATION = 'yanote.wsgi.application'
  42. DATABASES = {
  43. 'default': {
  44. 'ENGINE': 'django.db.backends.sqlite3',
  45. 'NAME': BASE_DIR / 'db.sqlite3',
  46. }
  47. }
  48. AUTH_PASSWORD_VALIDATORS = [
  49. {
  50. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  51. },
  52. {
  53. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  54. },
  55. ]
  56. LANGUAGE_CODE = 'ru'
  57. TIME_ZONE = 'Europe/Moscow'
  58. USE_I18N = True
  59. USE_L10N = True
  60. USE_TZ = True
  61. STATIC_URL = '/static/'
  62. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  63. LOGIN_URL = reverse_lazy('users:login')
  64. LOGIN_REDIRECT_URL = reverse_lazy('notes:home')