Advertisement
creativity_404

settings.py

Jun 27th, 2016
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.37 KB | None | 0 0
  1. """
  2. Django settings for restTutorial project.
  3.  
  4. Generated by 'django-admin startproject' using Django 1.9.1.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/1.9/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/1.9/ref/settings/
  11. """
  12.  
  13. import os
  14.  
  15. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  16. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  17.  
  18.  
  19. # Quick-start development settings - unsuitable for production
  20. # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
  21.  
  22. # SECURITY WARNING: keep the secret key used in production secret!
  23. SECRET_KEY = '[redacted]'
  24.  
  25. # SECURITY WARNING: don't run with debug turned on in production!
  26. DEBUG = True
  27.  
  28. ALLOWED_HOSTS = []
  29.  
  30.  
  31. # Application definition
  32.  
  33. INSTALLED_APPS = [
  34.     'django.contrib.admin',
  35.     'django.contrib.auth',
  36.     'django.contrib.contenttypes',
  37.     'django.contrib.sessions',
  38.     'django.contrib.messages',
  39.     'django.contrib.staticfiles',
  40.     'rest_framework',
  41.     'snippets',
  42.     'quickstart',
  43.  
  44. ]
  45.  
  46. REST_FRAMEWORK = {
  47.     'DEFAULT_PERMISSION_CLASSES':('rest_framework.permissions.AllowAny',),
  48.     'PAGE_SIZE': 10
  49. }
  50.  
  51. MIDDLEWARE_CLASSES = [
  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.auth.middleware.SessionAuthenticationMiddleware',
  58.     'django.contrib.messages.middleware.MessageMiddleware',
  59.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  60. ]
  61.  
  62. ROOT_URLCONF = 'restTutorial.urls'
  63.  
  64. TEMPLATES = [
  65.     {
  66.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  67.         'DIRS': [],
  68.         'APP_DIRS': True,
  69.         'OPTIONS': {
  70.             'context_processors': [
  71.                 'django.template.context_processors.debug',
  72.                 'django.template.context_processors.request',
  73.                 'django.contrib.auth.context_processors.auth',
  74.                 'django.contrib.messages.context_processors.messages',
  75.             ],
  76.         },
  77.     },
  78. ]
  79.  
  80. WSGI_APPLICATION = 'restTutorial.wsgi.application'
  81.  
  82.  
  83. # Database
  84. # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  85.  
  86. DATABASES = {
  87.     'default': {
  88.         'ENGINE': 'django.db.backends.sqlite3',
  89.         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  90.     }
  91. }
  92.  
  93.  
  94. # Password validation
  95. # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
  96.  
  97. AUTH_PASSWORD_VALIDATORS = [
  98.     {
  99.         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  100.     },
  101.     {
  102.         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  103.     },
  104.     {
  105.         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  106.     },
  107.     {
  108.         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  109.     },
  110. ]
  111.  
  112.  
  113. # Internationalization
  114. # https://docs.djangoproject.com/en/1.9/topics/i18n/
  115.  
  116. LANGUAGE_CODE = 'en-us'
  117.  
  118. TIME_ZONE = 'UTC'
  119.  
  120. USE_I18N = True
  121.  
  122. USE_L10N = True
  123.  
  124. USE_TZ = True
  125.  
  126.  
  127. # Static files (CSS, JavaScript, Images)
  128. # https://docs.djangoproject.com/en/1.9/howto/static-files/
  129.  
  130. STATIC_URL = '/static/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement