Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Django Settings.py

By: a guest on Jun 22nd, 2013  |  syntax: Python  |  size: 5.75 KB  |  views: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Django settings for galcon project.
  2. import os
  3. from django.conf import global_settings
  4.  
  5. #TEMPLATE_CONTEXT_PROCESSORS = global_settings.TREMPLATE_CONTEXT_PROCESSORS + ("django.contrib.messages.context_processors.messages",)
  6.  
  7.  
  8. DEBUG = True
  9. TEMPLATE_DEBUG = DEBUG
  10.  
  11. PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
  12.  
  13. ADMINS = (
  14.     # ('Your Name', 'your_email@example.com'),
  15. )
  16.  
  17. MANAGERS = ADMINS
  18.  
  19. DATABASES = {
  20.     'default': {
  21.         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  22.         'NAME': '/home/mark/Dropbox/Public/Galcon/database.db',                      # Or path to database file if using sqlite3.
  23.         # The following settings are not used with sqlite3:
  24.         'USER': '',
  25.         'PASSWORD': '',
  26.         'HOST': '',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
  27.         'PORT': '',                      # Set to empty string for default.
  28.     }
  29. }
  30.  
  31. # Hosts/domain names that are valid for this site; required if DEBUG is False
  32. # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
  33. ALLOWED_HOSTS = []
  34.  
  35. # Local time zone for this installation. Choices can be found here:
  36. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  37. # although not all choices may be available on all operating systems.
  38. # In a Windows environment this must be set to your system time zone.
  39. TIME_ZONE = 'America/New_York'
  40.  
  41. # Language code for this installation. All choices can be found here:
  42. # http://www.i18nguy.com/unicode/language-identifiers.html
  43. LANGUAGE_CODE = 'en-us'
  44.  
  45. SITE_ID = 1
  46.  
  47. # If you set this to False, Django will make some optimizations so as not
  48. # to load the internationalization machinery.
  49. USE_I18N = True
  50.  
  51. # If you set this to False, Django will not format dates, numbers and
  52. # calendars according to the current locale.
  53. USE_L10N = True
  54.  
  55. # If you set this to False, Django will not use timezone-aware datetimes.
  56. USE_TZ = True
  57.  
  58. # Absolute filesystem path to the directory that will hold user-uploaded files.
  59. # Example: "/var/www/example.com/media/"
  60. MEDIA_ROOT = ''
  61.  
  62. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  63. # trailing slash.
  64. # Examples: "http://example.com/media/", "http://media.example.com/"
  65. MEDIA_URL = ''
  66.  
  67. # Absolute path to the directory static files should be collected to.
  68. # Don't put anything in this directory yourself; store your static files
  69. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  70. # Example: "/var/www/example.com/static/"
  71. STATIC_ROOT = ''
  72.  
  73. # URL prefix for static files.
  74. # Example: "http://example.com/static/", "http://static.example.com/"
  75. STATIC_URL = PROJECT_PATH + '/site/'
  76.  
  77. # Additional locations of static files
  78. STATICFILES_DIRS = (
  79.     # Put strings here, like "/home/html/static" or "C:/www/django/static".
  80.     # Always use forward slashes, even on Windows.
  81.     # Don't forget to use absolute paths, not relative paths.
  82.     PROJECT_PATH + "/site/",
  83. )
  84.  
  85. # List of finder classes that know how to find static files in
  86. # various locations.
  87. STATICFILES_FINDERS = (
  88.     'django.contrib.staticfiles.finders.FileSystemFinder',
  89.     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  90. #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
  91. )
  92.  
  93. # Make this unique, and don't share it with anybody.
  94. SECRET_KEY = '@a)cmhrcxpcf=$++%_6n=@f_c&_tyv!2vviqkdv%i-o*jakjk3'
  95.  
  96. # List of callables that know how to import templates from various sources.
  97. TEMPLATE_LOADERS = (
  98.     'django.template.loaders.filesystem.Loader',
  99.     'django.template.loaders.app_directories.Loader',
  100. #     'django.template.loaders.eggs.Loader',
  101. )
  102.  
  103. MIDDLEWARE_CLASSES = (
  104.     'django.middleware.common.CommonMiddleware',
  105.     'django.contrib.sessions.middleware.SessionMiddleware',
  106.     'django.middleware.csrf.CsrfViewMiddleware',
  107.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  108.     'django.contrib.messages.middleware.MessageMiddleware',
  109.     # Uncomment the next line for simple clickjacking protection:
  110.     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  111. )
  112.  
  113. ROOT_URLCONF = 'galcon.urls'
  114.  
  115. # Python dotted path to the WSGI application used by Django's runserver.
  116. WSGI_APPLICATION = 'galcon.wsgi.application'
  117.  
  118. TEMPLATE_DIRS = (
  119.     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  120.     # Always use forward slashes, even on Windows.
  121.     # Don't forget to use absolute paths, not relative paths.
  122.     PROJECT_PATH
  123. )
  124.  
  125. INSTALLED_APPS = (
  126.     'django.contrib.auth',
  127.     'django.contrib.contenttypes',
  128.     'django.contrib.sessions',
  129.     'django.contrib.sites',
  130.     'django.contrib.messages',
  131.     'django.contrib.staticfiles',
  132.     # Uncomment the next line to enable the admin:
  133.      'django.contrib.admin',
  134.     # Uncomment the next line to enable admin documentation:
  135.     # 'django.contrib.admindocs',
  136.     "galcon",
  137. )
  138.  
  139. # A sample logging configuration. The only tangible logging
  140. # performed by this configuration is to send an email to
  141. # the site admins on every HTTP 500 error when DEBUG=False.
  142. # See http://docs.djangoproject.com/en/dev/topics/logging for
  143. # more details on how to customize your logging configuration.
  144. LOGGING = {
  145.     'version': 1,
  146.     'disable_existing_loggers': False,
  147.     'filters': {
  148.         'require_debug_false': {
  149.             '()': 'django.utils.log.RequireDebugFalse'
  150.         }
  151.     },
  152.     'handlers': {
  153.         'mail_admins': {
  154.             'level': 'ERROR',
  155.             'filters': ['require_debug_false'],
  156.             'class': 'django.utils.log.AdminEmailHandler'
  157.         }
  158.     },
  159.     'loggers': {
  160.         'django.request': {
  161.             'handlers': ['mail_admins'],
  162.             'level': 'ERROR',
  163.             'propagate': True,
  164.         },
  165.     }
  166. }