settings.py 5.4 KB

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