settings.py 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # Django settings for example project.
  2. import os
  3. PROJECT_ROOT = os.path.dirname(__file__)
  4. DEBUG = True
  5. TEMPLATE_DEBUG = DEBUG
  6. ADMINS = (
  7. # ('Your Name', 'your_email@example.com'),
  8. )
  9. MANAGERS = ADMINS
  10. DATABASES = {
  11. 'default': {
  12. 'ENGINE': 'django.db.backends.sqlite3',
  13. 'NAME': 'db.sqlite',
  14. 'USER': '', # Not used with sqlite3.
  15. 'PASSWORD': '', # Not used with sqlite3.
  16. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
  17. 'PORT': '', # Set to empty string for default. Not used with sqlite3.
  18. }
  19. }
  20. # Local time zone for this installation. Choices can be found here:
  21. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  22. # although not all choices may be available on all operating systems.
  23. # On Unix systems, a value of None will cause Django to use the same
  24. # timezone as the operating system.
  25. # If running in a Windows environment this must be set to the same as your
  26. # system time zone.
  27. TIME_ZONE = 'America/Chicago'
  28. # Language code for this installation. All choices can be found here:
  29. # http://www.i18nguy.com/unicode/language-identifiers.html
  30. LANGUAGE_CODE = 'en-us'
  31. SITE_ID = 1
  32. # If you set this to False, Django will make some optimizations so as not
  33. # to load the internationalization machinery.
  34. USE_I18N = True
  35. # If you set this to False, Django will not format dates, numbers and
  36. # calendars according to the current locale
  37. USE_L10N = True
  38. # Absolute filesystem path to the directory that will hold user-uploaded files.
  39. # Example: "/home/media/media.lawrence.com/media/"
  40. MEDIA_ROOT = ''
  41. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  42. # trailing slash.
  43. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  44. MEDIA_URL = ''
  45. # Absolute path to the directory static files should be collected to.
  46. # Don't put anything in this directory yourself; store your static files
  47. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  48. # Example: "/home/media/media.lawrence.com/static/"
  49. STATIC_ROOT = ''
  50. # URL prefix for static files.
  51. # Example: "http://media.lawrence.com/static/"
  52. STATIC_URL = '/static/'
  53. # Additional locations of static files
  54. STATICFILES_DIRS = (
  55. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  56. # Always use forward slashes, even on Windows.
  57. # Don't forget to use absolute paths, not relative paths.
  58. )
  59. # List of finder classes that know how to find static files in
  60. # various locations.
  61. STATICFILES_FINDERS = (
  62. 'django.contrib.staticfiles.finders.FileSystemFinder',
  63. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  64. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  65. )
  66. # Make this unique, and don't share it with anybody.
  67. SECRET_KEY = '(a_$ky*+pd#^nr14=kwis+75$#y2o8a40deb@2=qtsoadv7je9'
  68. # List of callables that know how to import templates from various sources.
  69. TEMPLATE_LOADERS = (
  70. 'django.template.loaders.filesystem.Loader',
  71. 'django.template.loaders.app_directories.Loader',
  72. # 'django.template.loaders.eggs.Loader',
  73. )
  74. MIDDLEWARE_CLASSES = (
  75. 'raven.contrib.django.middleware.SentryResponseErrorIdMiddleware',
  76. 'raven.contrib.django.middleware.Sentry404CatchMiddleware',
  77. 'django.middleware.common.CommonMiddleware',
  78. 'django.contrib.sessions.middleware.SessionMiddleware',
  79. 'django.middleware.csrf.CsrfViewMiddleware',
  80. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  81. 'django.contrib.messages.middleware.MessageMiddleware',
  82. 'sentry.middleware.SentryMiddleware',
  83. )
  84. ROOT_URLCONF = 'example.urls'
  85. TEMPLATE_DIRS = (
  86. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  87. # Always use forward slashes, even on Windows.
  88. # Don't forget to use absolute paths, not relative paths.
  89. os.path.join(PROJECT_ROOT, 'templates'),
  90. )
  91. LOCALE_PATHS = (
  92. os.path.join(PROJECT_ROOT, 'locale'),
  93. )
  94. INSTALLED_APPS = (
  95. 'django.contrib.auth',
  96. 'django.contrib.contenttypes',
  97. 'django.contrib.sessions',
  98. 'django.contrib.sites',
  99. 'django.contrib.messages',
  100. 'django.contrib.staticfiles',
  101. # Uncomment the next line to enable the admin:
  102. # 'django.contrib.admin',
  103. # Uncomment the next line to enable admin documentation:
  104. # 'django.contrib.admindocs',
  105. 'sentry',
  106. 'raven.contrib.django',
  107. )
  108. # DSN of your Sentry server
  109. # For info on configuring Django to use Sentry, see
  110. # http://raven.readthedocs.org/en/latest/config/django.html
  111. SENTRY_DSN = 'http://public:secret@example.com/1'
  112. # A sample logging configuration. The only tangible logging
  113. # performed by this configuration is to send an email to
  114. # the site admins on every HTTP 500 error.
  115. # See http://docs.djangoproject.com/en/dev/topics/logging for
  116. # more details on how to customize your logging configuration.
  117. LOGGING = {
  118. 'version': 1,
  119. 'disable_existing_loggers': True,
  120. 'root': {
  121. 'level': 'WARNING',
  122. 'handlers': ['sentry'],
  123. },
  124. 'handlers': {
  125. 'sentry': {
  126. 'level': 'WARNING',
  127. 'class': 'raven.contrib.django.handlers.SentryHandler',
  128. },
  129. 'mail_admins': {
  130. 'level': 'ERROR',
  131. 'class': 'django.utils.log.AdminEmailHandler',
  132. }
  133. },
  134. 'loggers': {
  135. 'django.request': {
  136. 'handlers': ['mail_admins'],
  137. 'level': 'ERROR',
  138. 'propagate': True,
  139. },
  140. }
  141. }