settings.py 5.1 KB

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