Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.28 KB | None | 0 0
  1. """
  2. Django settings for Exams project.
  3.  
  4. Generated by 'django-admin startproject' using Django 1.8.2.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/1.8/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/1.8/ref/settings/
  11. """
  12.  
  13. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  14. import os
  15.  
  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.8/howto/deployment/checklist/
  21.  
  22. # SECURITY WARNING: keep the secret key used in production secret!
  23. SECRET_KEY = '49p#h00f9a=*0jq-ravjx2i)02lz!$igr2go-_0c=d=cq+clrc'
  24.  
  25. # SECURITY WARNING: don't run with debug turned on in production!
  26. DEBUG = True
  27.  
  28. TEMPLATE_DEBUG = DEBUG
  29.  
  30. ALLOWED_HOSTS = []
  31.  
  32.  
  33. # Application definition
  34.  
  35. INSTALLED_APPS = (
  36.     'django.contrib.admin',
  37.     'django.contrib.auth',
  38.     'django.contrib.contenttypes',
  39.     'django.contrib.sessions',
  40.     'django.contrib.messages',
  41.     'django.contrib.staticfiles',
  42.     'poll',
  43. )
  44.  
  45. MIDDLEWARE_CLASSES = (
  46.     'django.contrib.sessions.middleware.SessionMiddleware',
  47.     'django.middleware.common.CommonMiddleware',
  48.     'django.middleware.csrf.CsrfViewMiddleware',
  49.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  50.     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  51.     'django.contrib.messages.middleware.MessageMiddleware',
  52.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  53.     'django.middleware.security.SecurityMiddleware',
  54. )
  55.  
  56. ROOT_URLCONF = 'Exams.urls'
  57.  
  58. TEMPLATES = [
  59.     {
  60.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  61.         'DIRS': [os.path.join(BASE_DIR, 'templates')],
  62.         'APP_DIRS': True,
  63.         'OPTIONS': {
  64.             'context_processors': [
  65.                 'django.template.context_processors.debug',
  66.                 'django.template.context_processors.request',
  67.                 'django.contrib.auth.context_processors.auth',
  68.                 'django.contrib.messages.context_processors.messages',
  69.             ],
  70.         },
  71.     },
  72. ]
  73.  
  74. WSGI_APPLICATION = 'Exams.wsgi.application'
  75.  
  76.  
  77. # Database
  78. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  79.  
  80. DATABASES = {
  81.     'default': {
  82.         'ENGINE': 'django.db.backends.mysql',
  83.         'NAME': 'exams',
  84.         'USER': 'root',
  85.         'PASSWORD': 'test123',
  86.         'HOST': '127.0.0.1',
  87.         'PORT': '3306',
  88.     }
  89. }
  90.  
  91.  
  92. # Internationalization
  93. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  94.  
  95. LANGUAGE_CODE = 'en-us'
  96.  
  97. TIME_ZONE = 'UTC'
  98.  
  99. USE_I18N = True
  100.  
  101. USE_L10N = True
  102.  
  103. USE_TZ = True
  104.  
  105.  
  106. # Static files (CSS, JavaScript, Images)
  107. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  108.  
  109. STATIC_URL = '/static/'
  110.  
  111. TEMPLATE_DIRS = (
  112.     os.path.join(os.path.dirname(BASE_DIR), "Exams", "templates"),
  113. )
  114.  
  115. if DEBUG:
  116.     MEDIA_URL = '/media/'
  117.     STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "Exams", "templates", "static", "static-only")
  118.     MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "Exams", "templates", "static", "media")
  119.     STATICFILES_DIRS = (
  120.         os.path.join(os.path.dirname(BASE_DIR), "Exams", "templates", "static", "static"),
  121.     )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement