Untitled

From anonymous, 1 Year ago, written in Plain Text, viewed 55 times.
URL https://paste.codexterous.com/view/b194cb0e Embed
Download Paste or View Raw
  1. """
  2. Django settings for auctions project.
  3. """
  4.  
  5. from os import path
  6. PROJECT_ROOT = path.dirname(path.abspath(path.dirname(__file__)))
  7.  
  8. DEBUG = True
  9. TEMPLATE_DEBUG = DEBUG
  10.  
  11. ALLOWED_HOSTS = (
  12.     'localhost',
  13. )
  14.  
  15. ADMINS = (
  16.     # ('Your Name', 'your_email@example.com'),
  17. )
  18.  
  19. MANAGERS = ADMINS
  20.  
  21. DATABASES = {
  22.     'default': {
  23.         'ENGINE': 'django.db.backends.sqlite3',
  24.         'NAME': path.join(PROJECT_ROOT, 'db.sqlite3'),
  25.         'USER': '',
  26.         'PASSWORD': '',
  27.         'HOST': '',
  28.         'PORT': '',
  29.     }
  30. }
  31.  
  32. LOGIN_URL = '/login'
  33.  
  34. # Local time zone for this installation. Choices can be found here:
  35. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  36. # although not all choices may be available on all operating systems.
  37. # On Unix systems, a value of None will cause Django to use the same
  38. # timezone as the operating system.
  39. # If running in a Windows environment this must be set to the same as your
  40. # system time zone.
  41. TIME_ZONE = 'America/Chicago'
  42.  
  43. # Language code for this installation. All choices can be found here:
  44. # http://www.i18nguy.com/unicode/language-identifiers.html
  45. LANGUAGE_CODE = 'en-us'
  46.  
  47. SITE_ID = 1
  48.  
  49. # If you set this to False, Django will make some optimizations so as not
  50. # to load the internationalization machinery.
  51. USE_I18N = True
  52.  
  53. # If you set this to False, Django will not format dates, numbers and
  54. # calendars according to the current locale.
  55. USE_L10N = True
  56.  
  57. # If you set this to False, Django will not use timezone-aware datetimes.
  58. USE_TZ = True
  59.  
  60. # Absolute filesystem path to the directory that will hold user-uploaded files.
  61. # Example: "/home/media/media.lawrence.com/media/"
  62. MEDIA_ROOT = ''
  63.  
  64. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  65. # trailing slash.
  66. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  67. MEDIA_URL = ''
  68.  
  69. # Absolute path to the directory static files should be collected to.
  70. # Don't put anything in this directory yourself; store your static files
  71. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  72. # Example: "/home/media/media.lawrence.com/static/"
  73. STATIC_ROOT = path.join(PROJECT_ROOT, 'static').replace('\\', '/')
  74.  
  75. # URL prefix for static files.
  76. # Example: "http://media.lawrence.com/static/"
  77. STATIC_URL = '/static/'
  78.  
  79. # Additional locations of static files
  80. STATICFILES_DIRS = (
  81.     # Put strings here, like "/home/html/static" or "C:/www/django/static".
  82.     # Always use forward slashes, even on Windows.
  83.     # Don't forget to use absolute paths, not relative paths.
  84. )
  85.  
  86. # List of finder classes that know how to find static files in
  87. # various locations.
  88. STATICFILES_FINDERS = (
  89.     'django.contrib.staticfiles.finders.FileSystemFinder',
  90.     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  91. #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
  92. )
  93.  
  94. # Make this unique, and don't share it with anybody.
  95. SECRET_KEY = '[secret]'
  96.  
  97. # List of callables that know how to import templates from various sources.
  98. #TEMPLATE_LOADERS = (
  99. #    'django.template.loaders.filesystem.Loader',
  100. #    'django.template.loaders.app_directories.Loader',
  101. ##     'django.template.loaders.eggs.Loader',
  102. #)
  103.  
  104. TEMPLATES = [
  105.  {
  106.    'BACKEND': 'django.template.backends.jinja2.Jinja2',
  107.    'DIRS': [],
  108.    'APP_DIRS': True,
  109.    'OPTIONS': {
  110.      #'environment': 'auctions.main.jinja2.environment'
  111.    },
  112.  },
  113. ]
  114.  
  115. MIDDLEWARE_CLASSES = (
  116.     'django.middleware.common.CommonMiddleware',
  117.     'django.contrib.sessions.middleware.SessionMiddleware',
  118.     'django.middleware.csrf.CsrfViewMiddleware',
  119.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  120.     'django.contrib.messages.middleware.MessageMiddleware',
  121.     # Uncomment the next line for simple clickjacking protection:
  122.     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  123. )
  124.  
  125. ROOT_URLCONF = 'auctions.urls'
  126.  
  127. # Python dotted path to the WSGI application used by Django's runserver.
  128. WSGI_APPLICATION = 'auctions.wsgi.application'
  129.  
  130. #TEMPLATE_DIRS = (
  131. #    # Put strings here, like "/home/html/django_templates" or
  132. #    # "C:/www/django/templates".
  133. #    # Always use forward slashes, even on Windows.
  134. #    # Don't forget to use absolute paths, not relative paths.
  135. #)
  136.  
  137. INSTALLED_APPS = (
  138.     'django.contrib.auth',
  139.     'django.contrib.contenttypes',
  140.     'django.contrib.sessions',
  141.     'django.contrib.sites',
  142.     'django.contrib.messages',
  143.     'django.contrib.staticfiles',
  144.     'auctions.main',
  145.     # Uncomment the next line to enable the admin:
  146.     # 'django.contrib.admin',
  147.     # Uncomment the next line to enable admin documentation:
  148.     # 'django.contrib.admindocs',
  149. )
  150.  
  151. # A sample logging configuration. The only tangible logging
  152. # performed by this configuration is to send an email to
  153. # the site admins on every HTTP 500 error when DEBUG=False.
  154. # See http://docs.djangoproject.com/en/dev/topics/logging for
  155. # more details on how to customize your logging configuration.
  156. LOGGING = {
  157.     'version': 1,
  158.     'disable_existing_loggers': False,
  159.     'filters': {
  160.         'require_debug_false': {
  161.             '()': 'django.utils.log.RequireDebugFalse'
  162.         }
  163.     },
  164.     'handlers': {
  165.         'mail_admins': {
  166.             'level': 'ERROR',
  167.             'filters': ['require_debug_false'],
  168.             'class': 'django.utils.log.AdminEmailHandler'
  169.         }
  170.     },
  171.     'loggers': {
  172.         'django.request': {
  173.             'handlers': ['mail_admins'],
  174.             'level': 'ERROR',
  175.             'propagate': True,
  176.         },
  177.     }
  178. }
  179.  
  180. # Specify the default test runner.
  181. TEST_RUNNER = 'django.test.runner.DiscoverRunner'
  182.  

Reply to "Untitled"

Here you can reply to the paste above