Advertisement
Guest User

settings.py

a guest
Aug 25th, 2024
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.85 KB | None | 0 0
  1. """
  2. Django settings for API_for_oddblox project.
  3.  
  4. Based on 'django-admin startproject' using Django 2.1.2.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/2.1/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/2.1/ref/settings/
  11. """
  12.  
  13. import os
  14. from pickle import FALSE
  15. import posixpath
  16. import mimetypes
  17.  
  18. mimetypes.add_type("text/javascript", ".js", True)
  19.  
  20. mimetypes.add_type("text/css", ".css", True)
  21.  
  22. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  23. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  24.  
  25. # Quick-start development settings - unsuitable for production
  26. # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
  27.  
  28. # SECURITY WARNING: keep the secret key used in production secret!
  29. SECRET_KEY = '5d8c1ecd-99a9-4fb2-b149-80acdc2a7f62'
  30.  
  31. # SECURITY WARNING: don't run with debug turned on in production!
  32. DEBUG = True
  33.  
  34. ALLOWED_HOSTS = []
  35.  
  36. # Application references
  37. # https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-INSTALLED_APPS
  38. INSTALLED_APPS = [
  39.     'app',
  40.     # Add your apps here to enable them
  41.     'django.contrib.admin',
  42.     'django.contrib.auth',
  43.     'django.contrib.contenttypes',
  44.     'django.contrib.sessions',
  45.     'django.contrib.messages',
  46.     'django.contrib.staticfiles',
  47. ]
  48.  
  49. # Middleware framework
  50. # https://docs.djangoproject.com/en/2.1/topics/http/middleware/
  51. MIDDLEWARE = [
  52.     'django.middleware.security.SecurityMiddleware',
  53.     'django.contrib.sessions.middleware.SessionMiddleware',
  54.     'django.middleware.common.CommonMiddleware',
  55.     'django.middleware.csrf.CsrfViewMiddleware',
  56.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  57.     'django.contrib.messages.middleware.MessageMiddleware',
  58.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  59. ]
  60.  
  61. ROOT_URLCONF = 'API_for_oddblox.urls'
  62.  
  63. # Template configuration
  64. # https://docs.djangoproject.com/en/2.1/topics/templates/
  65. TEMPLATES = [
  66.     {
  67.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  68.         'DIRS': [],
  69.         'APP_DIRS': True,
  70.         'OPTIONS': {
  71.             'context_processors': [
  72.                 'django.template.context_processors.debug',
  73.                 'django.template.context_processors.request',
  74.                 'django.contrib.auth.context_processors.auth',
  75.                 'django.contrib.messages.context_processors.messages',
  76.             ],
  77.         },
  78.     },
  79. ]
  80.  
  81. WSGI_APPLICATION = 'API_for_oddblox.wsgi.application'
  82. # Database
  83. # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
  84. DATABASES = {
  85.     'default': {
  86.         'ENGINE': 'django.db.backends.sqlite3',
  87.         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  88.     }
  89. }
  90.  
  91. # Password validation
  92. # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
  93. AUTH_PASSWORD_VALIDATORS = [
  94.     {
  95.         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  96.     },
  97.     {
  98.         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  99.     },
  100.     {
  101.         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  102.     },
  103.     {
  104.         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  105.     },
  106. ]
  107.  
  108. # Internationalization
  109. # https://docs.djangoproject.com/en/2.1/topics/i18n/
  110. LANGUAGE_CODE = 'en-us'
  111. TIME_ZONE = 'UTC'
  112. USE_I18N = True
  113. USE_L10N = True
  114. USE_TZ = True
  115.  
  116. # Static files (CSS, JavaScript, Images)
  117. # https://docs.djangoproject.com/en/2.1/howto/static-files/
  118. STATIC_URL = '/static/'
  119. # STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))
  120.  
  121. # Remove or comment out the following line during development
  122. # STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))
  123.  
  124. STATICFILES_DIRS = [
  125.     os.path.join(BASE_DIR, "static"),
  126. ]
  127.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement