settings.py 5.6 KB

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