Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. """
  2. Django settings for bookstore project.
  3.  
  4. Generated by 'django-admin startproject' using Django 2.0.7.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/2.0/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/2.0/ref/settings/
  11. """
  12.  
  13. import os
  14. import environ
  15.  
  16. # Identify the base directory of the project
  17. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  18.  
  19. # Declare a Environ object to hold environment parameters
  20. env = environ.Env()
  21.  
  22. # Read environment parameters from .env file to `env`
  23. environ.Env.read_env(os.path.join(BASE_DIR, ".env"))
  24.  
  25. # Quick-start development settings - unsuitable for production
  26. # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
  27.  
  28. # SECURITY WARNING: keep the secret key used in production secret!
  29. SECRET_KEY = env("SECRET_KEY")
  30.  
  31. # SECURITY WARNING: don't run with debug turned on in production!
  32. DEBUG = env("DEBUG")
  33.  
  34. ALLOWED_HOSTS = []
  35.  
  36.  
  37. # Application definition
  38.  
  39. INSTALLED_APPS = [
  40. 'django.contrib.admin',
  41. 'django.contrib.auth',
  42. 'django.contrib.contenttypes',
  43. 'django.contrib.sessions',
  44. 'django.contrib.messages',
  45. 'django.contrib.staticfiles',
  46. ]
  47.  
  48. MIDDLEWARE = [
  49. 'django.middleware.security.SecurityMiddleware',
  50. 'django.contrib.sessions.middleware.SessionMiddleware',
  51. 'django.middleware.common.CommonMiddleware',
  52. 'django.middleware.csrf.CsrfViewMiddleware',
  53. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  54. 'django.contrib.messages.middleware.MessageMiddleware',
  55. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  56. ]
  57.  
  58. ROOT_URLCONF = 'bookstore.urls'
  59.  
  60. TEMPLATES = [
  61. {
  62. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  63. 'DIRS': [],
  64. 'APP_DIRS': True,
  65. 'OPTIONS': {
  66. 'context_processors': [
  67. 'django.template.context_processors.debug',
  68. 'django.template.context_processors.request',
  69. 'django.contrib.auth.context_processors.auth',
  70. 'django.contrib.messages.context_processors.messages',
  71. ],
  72. },
  73. },
  74. ]
  75.  
  76. WSGI_APPLICATION = 'bookstore.wsgi.application'
  77.  
  78.  
  79. # Database
  80. # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
  81.  
  82. DATABASES = {
  83. 'default': env.db() # Raises ImproperlyConfigured exception if DATABASE_URL
  84. # not in os.environ
  85. }
  86.  
  87.  
  88. # Password validation
  89. # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
  90.  
  91. AUTH_PASSWORD_VALIDATORS = [
  92. {
  93. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  94. },
  95. {
  96. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  97. },
  98. {
  99. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  100. },
  101. {
  102. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  103. },
  104. ]
  105.  
  106.  
  107. # Internationalization
  108. # https://docs.djangoproject.com/en/2.0/topics/i18n/
  109.  
  110. LANGUAGE_CODE = 'en-us'
  111.  
  112. TIME_ZONE = 'UTC'
  113.  
  114. USE_I18N = True
  115.  
  116. USE_L10N = True
  117.  
  118. USE_TZ = True
  119.  
  120.  
  121. # Static files (CSS, JavaScript, Images)
  122. # https://docs.djangoproject.com/en/2.0/howto/static-files/
  123.  
  124. STATIC_URL = '/static/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement