settings.py 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. # Django settings for proj project.
  12. DEBUG = True
  13. TEMPLATE_DEBUG = DEBUG
  14. ADMINS = (
  15. # ('Your Name', 'your_email@example.com'),
  16. )
  17. MANAGERS = ADMINS
  18. DATABASES = {
  19. 'default': {
  20. # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  21. 'ENGINE': 'django.db.backends.sqlite3',
  22. 'NAME': 'test.db', # path to database file if using sqlite3.
  23. 'USER': '', # Not used with sqlite3.
  24. 'PASSWORD': '', # Not used with sqlite3.
  25. 'HOST': '', # Set to empty string for localhost.
  26. # Not used with sqlite3.
  27. 'PORT': '', # Set to empty string for default.
  28. # Not used with sqlite3.
  29. }
  30. }
  31. # Local time zone for this installation. Choices can be found here:
  32. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  33. # although not all choices may be available on all operating systems.
  34. # In a Windows environment this must be set to your system time zone.
  35. TIME_ZONE = 'America/Chicago'
  36. # Language code for this installation. All choices can be found here:
  37. # http://www.i18nguy.com/unicode/language-identifiers.html
  38. LANGUAGE_CODE = 'en-us'
  39. SITE_ID = 1
  40. # If you set this to False, Django will make some optimizations so as not
  41. # to load the internationalization machinery.
  42. USE_I18N = True
  43. # If you set this to False, Django will not format dates, numbers and
  44. # calendars according to the current locale.
  45. USE_L10N = True
  46. # If you set this to False, Django will not use timezone-aware datetimes.
  47. USE_TZ = True
  48. # Absolute filesystem path to the directory that will hold user-uploaded files.
  49. # Example: "/home/media/media.lawrence.com/media/"
  50. MEDIA_ROOT = ''
  51. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  52. # trailing slash.
  53. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  54. MEDIA_URL = ''
  55. # Absolute path to the directory static files should be collected to.
  56. # Don't put anything in this directory yourself; store your static files
  57. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  58. # Example: "/home/media/media.lawrence.com/static/"
  59. STATIC_ROOT = ''
  60. # URL prefix for static files.
  61. # Example: "http://media.lawrence.com/static/"
  62. STATIC_URL = '/static/'
  63. # Additional locations of static files
  64. STATICFILES_DIRS = (
  65. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  66. # Always use forward slashes, even on Windows.
  67. # Don't forget to use absolute paths, not relative paths.
  68. )
  69. # List of finder classes that know how to find static files in
  70. # various locations.
  71. STATICFILES_FINDERS = (
  72. 'django.contrib.staticfiles.finders.FileSystemFinder',
  73. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  74. )
  75. # Make this unique, and don't share it with anybody.
  76. SECRET_KEY = 'x2$s&0z2xehpnt_99i8q3)4)t*5q@+n(+6jrqz4@rt%a8fdf+!'
  77. # List of callables that know how to import templates from various sources.
  78. TEMPLATE_LOADERS = (
  79. 'django.template.loaders.filesystem.Loader',
  80. 'django.template.loaders.app_directories.Loader',
  81. )
  82. MIDDLEWARE_CLASSES = (
  83. 'django.middleware.common.CommonMiddleware',
  84. 'django.contrib.sessions.middleware.SessionMiddleware',
  85. 'django.middleware.csrf.CsrfViewMiddleware',
  86. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  87. 'django.contrib.messages.middleware.MessageMiddleware',
  88. # Uncomment the next line for simple clickjacking protection:
  89. # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  90. )
  91. ROOT_URLCONF = 'proj.urls'
  92. # Python dotted path to the WSGI application used by Django's runserver.
  93. WSGI_APPLICATION = 'proj.wsgi.application'
  94. TEMPLATE_DIRS = (
  95. # Put strings here, like "/home/html/django_templates"
  96. # or "C:/www/django/templates".
  97. # Always use forward slashes, even on Windows.
  98. # Don't forget to use absolute paths, not relative paths.
  99. )
  100. INSTALLED_APPS = (
  101. 'django.contrib.auth',
  102. 'django.contrib.contenttypes',
  103. 'django.contrib.sessions',
  104. 'django.contrib.sites',
  105. 'django.contrib.messages',
  106. 'django.contrib.staticfiles',
  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. }