settings.py 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. from __future__ import absolute_import, unicode_literals
  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. CELERY_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_RESULT_BACKEND = 'db+sqlite:///results.sqlite'
  12. CELERY_TASK_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. # https://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 file-system path to the directory that will hold
  51. # user-uploaded files.
  52. # Example: '/home/media/media.lawrence.com/media/'
  53. MEDIA_ROOT = ''
  54. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  55. # trailing slash.
  56. # Examples: 'http://media.lawrence.com/media/', 'http://example.com/media/'
  57. MEDIA_URL = ''
  58. # Absolute path to the directory static files should be collected to.
  59. # Don't put anything in this directory yourself; store your static files
  60. # in apps' 'static/' subdirectories and in STATICFILES_DIRS.
  61. # Example: '/home/media/media.lawrence.com/static/'
  62. STATIC_ROOT = ''
  63. # URL prefix for static files.
  64. # Example: 'http://media.lawrence.com/static/'
  65. STATIC_URL = '/static/'
  66. # Additional locations of static files
  67. STATICFILES_DIRS = (
  68. # Put strings here, like '/home/html/static' or 'C:/www/django/static'.
  69. # Always use forward slashes, even on Windows.
  70. # Don't forget to use absolute paths, not relative paths.
  71. )
  72. # List of finder classes that know how to find static files in
  73. # various locations.
  74. STATICFILES_FINDERS = (
  75. 'django.contrib.staticfiles.finders.FileSystemFinder',
  76. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  77. )
  78. # Make this unique, and don't share it with anybody.
  79. SECRET_KEY = 'x2$s&0z2xehpnt_99i8q3)4)t*5q@+n(+6jrqz4@rt%a8fdf+!'
  80. # List of callables that know how to import templates from various sources.
  81. TEMPLATE_LOADERS = (
  82. 'django.template.loaders.filesystem.Loader',
  83. 'django.template.loaders.app_directories.Loader',
  84. )
  85. MIDDLEWARE_CLASSES = (
  86. 'django.middleware.common.CommonMiddleware',
  87. 'django.contrib.sessions.middleware.SessionMiddleware',
  88. 'django.middleware.csrf.CsrfViewMiddleware',
  89. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  90. 'django.contrib.messages.middleware.MessageMiddleware',
  91. # Uncomment the next line for simple clickjacking protection:
  92. # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  93. )
  94. ROOT_URLCONF = 'proj.urls'
  95. # Python dotted path to the WSGI application used by Django's runserver.
  96. WSGI_APPLICATION = 'proj.wsgi.application'
  97. TEMPLATE_DIRS = (
  98. # Put strings here, like '/home/html/django_templates'
  99. # or 'C:/www/django/templates'.
  100. # Always use forward slashes, even on Windows.
  101. # Don't forget to use absolute paths, not relative paths.
  102. )
  103. INSTALLED_APPS = (
  104. 'django.contrib.auth',
  105. 'django.contrib.contenttypes',
  106. 'django.contrib.sessions',
  107. 'django.contrib.sites',
  108. 'django.contrib.messages',
  109. 'django.contrib.staticfiles',
  110. 'django.contrib.admin',
  111. 'kombu.transport.django',
  112. 'demoapp',
  113. # Uncomment the next line to enable the admin:
  114. # 'django.contrib.admin',
  115. # Uncomment the next line to enable admin documentation:
  116. # 'django.contrib.admindocs',
  117. )
  118. # A sample logging configuration. The only tangible logging
  119. # performed by this configuration is to send an email to
  120. # the site admins on every HTTP 500 error when DEBUG=False.
  121. # See http://docs.djangoproject.com/en/dev/topics/logging for
  122. # more details on how to customize your logging configuration.
  123. LOGGING = {
  124. 'version': 1,
  125. 'disable_existing_loggers': False,
  126. 'filters': {
  127. 'require_debug_false': {
  128. '()': 'django.utils.log.RequireDebugFalse'
  129. }
  130. },
  131. 'handlers': {
  132. 'mail_admins': {
  133. 'level': 'ERROR',
  134. 'filters': ['require_debug_false'],
  135. 'class': 'django.utils.log.AdminEmailHandler'
  136. }
  137. },
  138. 'loggers': {
  139. 'django.request': {
  140. 'handlers': ['mail_admins'],
  141. 'level': 'ERROR',
  142. 'propagate': True,
  143. },
  144. }
  145. }