settings.py 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. from __future__ import absolute_import
  2. # ^^^ The above is required if you want to import from the celery
  3. # library. If you don't have this then `from celery.schedules import`
  4. # becomes `proj.celery.schedules` in Python 2.x since it allows
  5. # for relative imports by default.
  6. # Celery settings
  7. BROKER_URL = 'amqp://guest:guest@localhost//'
  8. #: Only add pickle to this list if your broker is secured
  9. #: from unwanted access (see userguide/security.html)
  10. CELERY_ACCEPT_CONTENT = ['json']
  11. CELERY_TASK_SERIALIZER = 'json'
  12. CELERY_RESULT_SERIALIZER = 'json'
  13. # Django settings for proj project.
  14. DEBUG = True
  15. TEMPLATE_DEBUG = DEBUG
  16. ADMINS = (
  17. # ('Your Name', 'your_email@example.com'),
  18. )
  19. MANAGERS = ADMINS
  20. DATABASES = {
  21. 'default': {
  22. # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  23. 'ENGINE': 'django.db.backends.sqlite3',
  24. 'NAME': 'test.db', # path to database file if using sqlite3.
  25. 'USER': '', # Not used with sqlite3.
  26. 'PASSWORD': '', # Not used with sqlite3.
  27. 'HOST': '', # Set to empty string for localhost.
  28. # Not used with sqlite3.
  29. 'PORT': '', # Set to empty string for default.
  30. # Not used with sqlite3.
  31. }
  32. }
  33. # Local time zone for this installation. Choices can be found here:
  34. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  35. # although not all choices may be available on all operating systems.
  36. # In a Windows environment this must be set to your system time zone.
  37. TIME_ZONE = 'America/Chicago'
  38. # Language code for this installation. All choices can be found here:
  39. # http://www.i18nguy.com/unicode/language-identifiers.html
  40. LANGUAGE_CODE = 'en-us'
  41. SITE_ID = 1
  42. # If you set this to False, Django will make some optimizations so as not
  43. # to load the internationalization machinery.
  44. USE_I18N = True
  45. # If you set this to False, Django will not format dates, numbers and
  46. # calendars according to the current locale.
  47. USE_L10N = True
  48. # If you set this to False, Django will not use timezone-aware datetimes.
  49. USE_TZ = True
  50. # Absolute filesystem path to the directory that will hold user-uploaded files.
  51. # Example: "/home/media/media.lawrence.com/media/"
  52. MEDIA_ROOT = ''
  53. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  54. # trailing slash.
  55. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  56. MEDIA_URL = ''
  57. # Absolute path to the directory static files should be collected to.
  58. # Don't put anything in this directory yourself; store your static files
  59. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  60. # Example: "/home/media/media.lawrence.com/static/"
  61. STATIC_ROOT = ''
  62. # URL prefix for static files.
  63. # Example: "http://media.lawrence.com/static/"
  64. STATIC_URL = '/static/'
  65. # Additional locations of static files
  66. STATICFILES_DIRS = (
  67. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  68. # Always use forward slashes, even on Windows.
  69. # Don't forget to use absolute paths, not relative paths.
  70. )
  71. # List of finder classes that know how to find static files in
  72. # various locations.
  73. STATICFILES_FINDERS = (
  74. 'django.contrib.staticfiles.finders.FileSystemFinder',
  75. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  76. )
  77. # Make this unique, and don't share it with anybody.
  78. SECRET_KEY = 'x2$s&0z2xehpnt_99i8q3)4)t*5q@+n(+6jrqz4@rt%a8fdf+!'
  79. # List of callables that know how to import templates from various sources.
  80. TEMPLATE_LOADERS = (
  81. 'django.template.loaders.filesystem.Loader',
  82. 'django.template.loaders.app_directories.Loader',
  83. )
  84. MIDDLEWARE_CLASSES = (
  85. 'django.middleware.common.CommonMiddleware',
  86. 'django.contrib.sessions.middleware.SessionMiddleware',
  87. 'django.middleware.csrf.CsrfViewMiddleware',
  88. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  89. 'django.contrib.messages.middleware.MessageMiddleware',
  90. # Uncomment the next line for simple clickjacking protection:
  91. # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  92. )
  93. ROOT_URLCONF = 'proj.urls'
  94. # Python dotted path to the WSGI application used by Django's runserver.
  95. WSGI_APPLICATION = 'proj.wsgi.application'
  96. TEMPLATE_DIRS = (
  97. # Put strings here, like "/home/html/django_templates"
  98. # or "C:/www/django/templates".
  99. # Always use forward slashes, even on Windows.
  100. # Don't forget to use absolute paths, not relative paths.
  101. )
  102. INSTALLED_APPS = (
  103. 'django.contrib.auth',
  104. 'django.contrib.contenttypes',
  105. 'django.contrib.sessions',
  106. 'django.contrib.sites',
  107. 'django.contrib.messages',
  108. 'django.contrib.staticfiles',
  109. 'django.contrib.admin',
  110. 'kombu.transport.django',
  111. 'demoapp',
  112. # Uncomment the next line to enable the admin:
  113. # 'django.contrib.admin',
  114. # Uncomment the next line to enable admin documentation:
  115. # 'django.contrib.admindocs',
  116. )
  117. # A sample logging configuration. The only tangible logging
  118. # performed by this configuration is to send an email to
  119. # the site admins on every HTTP 500 error when DEBUG=False.
  120. # See http://docs.djangoproject.com/en/dev/topics/logging for
  121. # more details on how to customize your logging configuration.
  122. LOGGING = {
  123. 'version': 1,
  124. 'disable_existing_loggers': False,
  125. 'filters': {
  126. 'require_debug_false': {
  127. '()': 'django.utils.log.RequireDebugFalse'
  128. }
  129. },
  130. 'handlers': {
  131. 'mail_admins': {
  132. 'level': 'ERROR',
  133. 'filters': ['require_debug_false'],
  134. 'class': 'django.utils.log.AdminEmailHandler'
  135. }
  136. },
  137. 'loggers': {
  138. 'django.request': {
  139. 'handlers': ['mail_admins'],
  140. 'level': 'ERROR',
  141. 'propagate': True,
  142. },
  143. }
  144. }