Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.57 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. """
  4. Django settings for intopython project.
  5.  
  6. Generated by 'django-admin startproject' using Django 1.8.5.
  7.  
  8. For more information on this file, see
  9. https://docs.djangoproject.com/en/1.8/topics/settings/
  10.  
  11. For the full list of settings and their values, see
  12. https://docs.djangoproject.com/en/1.8/ref/settings/
  13. """
  14.  
  15. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  16. import os
  17. import django
  18.  
  19. BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  20.  
  21.  
  22. # Quick-start development settings - unsuitable for production
  23. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  24.  
  25. # SECURITY WARNING: keep the secret key used in production secret!
  26. SECRET_KEY = '...'
  27.  
  28. # SECURITY WARNING: don't run with debug turned on in production!
  29. DEBUG = False
  30.  
  31. ALLOWED_HOSTS = []
  32.  
  33.  
  34. # Application definition
  35.  
  36. INSTALLED_APPS = (
  37.     'django.contrib.admin',
  38.     'django.contrib.auth',
  39.     'django.contrib.contenttypes',
  40.     'django.contrib.sessions',
  41.     'django.contrib.messages',
  42.     'django.contrib.staticfiles',
  43.     'django.forms',
  44.  
  45.     'taggit',
  46.     # 'django_pygments',
  47.     'markdownx',
  48.  
  49.     'src.articles',
  50.     'src.blog',
  51.     'src.screencasts',
  52.     'src.courses',
  53.     'src.landing',
  54.     'src.registration',
  55.     'src.payments'
  56. )
  57.  
  58. MIDDLEWARE_CLASSES = (
  59.     'django.contrib.sessions.middleware.SessionMiddleware',
  60.     'django.middleware.common.CommonMiddleware',
  61.     'django.middleware.csrf.CsrfViewMiddleware',
  62.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  63.     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  64.     'django.contrib.messages.middleware.MessageMiddleware',
  65.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  66.     'django.middleware.security.SecurityMiddleware',
  67.     'debug_toolbar.middleware.DebugToolbarMiddleware',
  68. )
  69.  
  70. ROOT_URLCONF = 'intopython.urls'
  71.  
  72. TEMPLATES = [
  73.     {
  74.         # http://niwinz.github.io/django-jinja/#_introduction_3
  75.         "BACKEND": "django_jinja.backend.Jinja2",
  76.         'DIRS': [
  77.             os.path.join(BASE_DIR, 'templates'),
  78.             os.path.join(django.__path__[0], 'forms', 'jinja2'),
  79.         ],
  80.         # "APP_DIRS": True,
  81.         "OPTIONS": {
  82.             "match_extension": ".html",
  83.             "match_regex": r"^(?!(admin|debug_toolbar)/).*",
  84.             # "match_regex": r"^(?!admin/).*",
  85.             "app_dirname": "templates",
  86.             # "autoescape": True,
  87.             # "auto_reload": DEBUG,
  88.             "filters": {
  89.                 "set_css_class": "src.common.css_filters.set_css_class",
  90.             },
  91.             'context_processors': (
  92.                 'src.common.context_processors.common_variables_to_context',
  93.             )
  94.  
  95.         }
  96.     },
  97.     {
  98.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  99.         'DIRS': [
  100.         ],
  101.         "APP_DIRS": True,
  102.         'OPTIONS': {
  103.             'context_processors': [
  104.                 'django.template.context_processors.debug',
  105.                 'django.template.context_processors.request',
  106.                 'django.contrib.auth.context_processors.auth',
  107.                 'django.contrib.messages.context_processors.messages',
  108.             ],
  109.         },
  110.     },
  111. ]
  112. FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
  113.  
  114. WSGI_APPLICATION = 'intopython.wsgi.application'
  115.  
  116.  
  117. # Database
  118. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  119.  
  120. DATABASES = {
  121.     'default': {
  122.         'ENGINE': 'django.db.backends.mysql',
  123.         'NAME': '...',
  124.         'USER': '...',
  125.         'PASSWORD': '...',
  126.         # 'HOST': '127.0.0.1',
  127.         # 'PORT': '5432',
  128.     }
  129. }
  130.  
  131. # Internationalization
  132. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  133.  
  134. # Language code for this installation. All choices can be found here:
  135. # http://www.i18nguy.com/unicode/language-identifiers.html
  136. LANGUAGE_CODE = 'ru'
  137.  
  138. TIME_ZONE = 'Europe/Moscow'
  139. USE_I18N = True
  140. USE_L10N = True
  141. USE_TZ = True
  142.  
  143.  
  144. # Static files (CSS, JavaScript, Images)
  145. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  146.  
  147. STATIC_URL = '/static/'
  148. STATICFILES_DIRS = (
  149.     os.path.join(BASE_DIR, "static"),
  150. )
  151. STATIC_ROOT = os.path.join(BASE_DIR, 'extra', 'static')
  152.  
  153. MEDIA_URL = '/media/'
  154. MEDIA_ROOT = os.path.join(BASE_DIR, 'extra', 'media')
  155.  
  156. TAGGIT_CASE_INSENSITIVE = True
  157.  
  158. MYSQL_DUMPS_PATH = os.path.join(BASE_DIR, 'extra')
  159.  
  160. AUTH_USER_MODEL = 'registration.MyUser'
  161.  
  162. LOGIN_REDIRECT_URL = '/'
  163.  
  164. LOG_DIR = os.path.join(BASE_DIR, 'logs')
  165. LOG_FILE_NAME = os.path.join(LOG_DIR, 'intopython.log')
  166.  
  167. MARKDOWNX_EDITOR_RESIZABLE = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement