Guest User

Untitled

a guest
Apr 5th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1.  
  2. import os
  3.  
  4. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  5. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  6.  
  7.  
  8. # Quick-start development settings - unsuitable for production
  9. # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
  10.  
  11. # SECURITY WARNING: keep the secret key used in production secret!
  12. SECRET_KEY = 'exhlfdat&vfum(-34*c2uroi(($ww(yo$9pv98=e6p^gl(-eoj'
  13.  
  14. # SECURITY WARNING: don't run with debug turned on in production!
  15. DEBUG = True
  16.  
  17. ALLOWED_HOSTS = []
  18.  
  19.  
  20. # Application definition
  21.  
  22. INSTALLED_APPS = [
  23. 'blog.apps.BlogConfig',
  24. 'users.apps.UsersConfig',
  25. 'crispy_forms',
  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. ]
  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.  
  44. ROOT_URLCONF = 'django_project.urls'
  45.  
  46. TEMPLATES = [
  47. {
  48. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  49. 'DIRS': [],
  50. 'APP_DIRS': True,
  51. 'OPTIONS': {
  52. 'context_processors': [
  53. 'django.template.context_processors.debug',
  54. 'django.template.context_processors.request',
  55. 'django.contrib.auth.context_processors.auth',
  56. 'django.contrib.messages.context_processors.messages',
  57. ],
  58. },
  59. },
  60. ]
  61.  
  62. WSGI_APPLICATION = 'django_project.wsgi.application'
  63.  
  64.  
  65. # Database
  66. # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
  67.  
  68. DATABASES = {
  69. 'default': {
  70. 'ENGINE': 'django.db.backends.sqlite3',
  71. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  72. }
  73. }
  74.  
  75.  
  76. # Password validation
  77. # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
  78.  
  79. AUTH_PASSWORD_VALIDATORS = [
  80. {
  81. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  82. },
  83. {
  84. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  85. },
  86. {
  87. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  88. },
  89. {
  90. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  91. },
  92. ]
  93.  
  94.  
  95. # Internationalization
  96. # https://docs.djangoproject.com/en/2.1/topics/i18n/
  97.  
  98. LANGUAGE_CODE = 'en-us'
  99.  
  100. TIME_ZONE = 'UTC'
  101.  
  102. USE_I18N = True
  103.  
  104. USE_L10N = True
  105.  
  106. USE_TZ = True
  107.  
  108.  
  109. # Static files (CSS, JavaScript, Images)
  110. # https://docs.djangoproject.com/en/2.1/howto/static-files/
  111.  
  112. STATIC_URL = '/static/'
  113.  
  114. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  115. MEDIA_URL = '/media/'
  116.  
  117. CRISPY_TEMPLATE_PACK = 'bootstrap4'
  118.  
  119. LOGIN_REDIRECT_URL = 'home'
  120. LOGIN_URL = 'login'
  121.  
  122. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  123. EMAIL_HOST = 'smtp.gmail.com'
  124. EMAIL_PORT = 587
  125. EMAIL_USE_TLS = True
  126. EMAIL_HOST_USER = os.environ.get('EMAIL_USER')
  127. EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_PASS')
Add Comment
Please, Sign In to add comment