We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
500 errors should log stack trace by default
Running Django with DEBUG=True is too verbose (and bad practice), but we need to see errors when they occur.

See issue #77. 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `deis/settings.py`
Content:
```
1 """
2 Django settings for the Deis project.
3 """
4 
5 from __future__ import unicode_literals
6 import os.path
7 
8 
9 PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
10 
11 DEBUG = False
12 TEMPLATE_DEBUG = DEBUG
13 
14 ADMINS = (
15     # ('Your Name', 'your_email@example.com'),
16 )
17 
18 MANAGERS = ADMINS
19 
20 DATABASES = {
21     'default': {
22         'ENGINE': 'django.db.backends.',
23         'NAME': '',
24         'USER': '',
25         'PASSWORD': '',
26         'HOST': '',
27         'PORT': '',
28     }
29 }
30 
31 # Hosts/domain names that are valid for this site; required if DEBUG is False
32 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
33 ALLOWED_HOSTS = ['localhost']
34 
35 # Local time zone for this installation. Choices can be found here:
36 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
37 # although not all choices may be available on all operating systems.
38 # In a Windows environment this must be set to your system time zone.
39 TIME_ZONE = 'America/Denver'
40 
41 # Language code for this installation. All choices can be found here:
42 # http://www.i18nguy.com/unicode/language-identifiers.html
43 LANGUAGE_CODE = 'en-us'
44 
45 SITE_ID = 1
46 
47 # If you set this to False, Django will make some optimizations so as not
48 # to load the internationalization machinery.
49 USE_I18N = True
50 
51 # If you set this to False, Django will not format dates, numbers and
52 # calendars according to the current locale.
53 USE_L10N = True
54 
55 # If you set this to False, Django will not use timezone-aware datetimes.
56 USE_TZ = True
57 
58 # Absolute filesystem path to the directory that will hold user-uploaded files.
59 # Example: "/var/www/example.com/media/"
60 MEDIA_ROOT = ''
61 
62 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
63 # trailing slash.
64 # Examples: "http://example.com/media/", "http://media.example.com/"
65 MEDIA_URL = ''
66 
67 # Absolute path to the directory static files should be collected to.
68 # Don't put anything in this directory yourself; store your static files
69 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
70 # Example: "/var/www/example.com/static/"
71 STATIC_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', 'static'))
72 
73 # URL prefix for static files.
74 # Example: "http://example.com/static/", "http://static.example.com/"
75 STATIC_URL = '/static/'
76 
77 # Additional locations of static files
78 STATICFILES_DIRS = (
79     # Put strings here, like "/home/html/static" or "C:/www/django/static".
80     # Always use forward slashes, even on Windows.
81     # Don't forget to use absolute paths, not relative paths.
82 )
83 
84 # List of finder classes that know how to find static files in
85 # various locations.
86 STATICFILES_FINDERS = (
87     'django.contrib.staticfiles.finders.FileSystemFinder',
88     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
89 )
90 
91 # Make this unique, and don't share it with anybody.
92 SECRET_KEY = None  # @UnusedVariable
93 
94 # List of callables that know how to import templates from various sources.
95 TEMPLATE_LOADERS = (
96     'django.template.loaders.filesystem.Loader',
97     'django.template.loaders.app_directories.Loader',
98 )
99 
100 TEMPLATE_CONTEXT_PROCESSORS = (
101     "django.contrib.auth.context_processors.auth",
102     "django.core.context_processors.debug",
103     "django.core.context_processors.i18n",
104     "django.core.context_processors.media",
105     "django.core.context_processors.request",
106     "django.core.context_processors.static",
107     "django.core.context_processors.tz",
108     "django.contrib.messages.context_processors.messages",
109     "allauth.account.context_processors.account",
110     "allauth.socialaccount.context_processors.socialaccount",
111 )
112 
113 MIDDLEWARE_CLASSES = (
114     'django.middleware.common.CommonMiddleware',
115     'django.contrib.sessions.middleware.SessionMiddleware',
116     'django.middleware.csrf.CsrfViewMiddleware',
117     'django.contrib.auth.middleware.AuthenticationMiddleware',
118     'django.contrib.messages.middleware.MessageMiddleware',
119     # Uncomment the next line for simple clickjacking protection:
120     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
121 )
122 
123 ROOT_URLCONF = 'deis.urls'
124 
125 # Python dotted path to the WSGI application used by Django's runserver.
126 WSGI_APPLICATION = 'deis.wsgi.application'
127 
128 TEMPLATE_DIRS = (
129     # Put strings here, like "/home/html/django_templates"
130     # or "C:/www/django/templates".
131     # Always use forward slashes, even on Windows.
132     # Don't forget to use absolute paths, not relative paths.
133     PROJECT_ROOT + '/web/templates',
134 )
135 
136 INSTALLED_APPS = (
137     'django.contrib.admin',
138     'django.contrib.auth',
139     'django.contrib.contenttypes',
140     'django.contrib.messages',
141     'django.contrib.sessions',
142     'django.contrib.sites',
143     'django.contrib.staticfiles',
144     # Third-party apps
145     'allauth',
146     'allauth.account',
147     'allauth.socialaccount',
148     'djcelery',
149     'json_field',
150     'rest_framework',
151     'south',
152     # Deis apps
153     'api',
154     'celerytasks',
155     'client',
156     'web',
157 )
158 
159 AUTHENTICATION_BACKENDS = (
160     # Needed to login by username in Django admin, regardless of `allauth`
161     "django.contrib.auth.backends.ModelBackend",
162     # `allauth` specific authentication methods, such as login by e-mail
163     "allauth.account.auth_backends.AuthenticationBackend",
164 )
165 
166 ACCOUNT_EMAIL_REQUIRED = True
167 ACCOUNT_EMAIL_VERIFICATION = 'none'
168 ACCOUNT_LOGOUT_ON_GET = True
169 ACCOUNT_USERNAME_BLACKLIST = ['system']
170 LOGIN_REDIRECT_URL = '/dashboard/'
171 
172 
173 SOUTH_TESTS_MIGRATE = False
174 
175 REST_FRAMEWORK = {
176     'DEFAULT_MODEL_SERIALIZER_CLASS':
177     'rest_framework.serializers.ModelSerializer',
178     'DEFAULT_PERMISSION_CLASSES': (
179         'rest_framework.permissions.IsAuthenticated',
180     ),
181     'DEFAULT_AUTHENTICATION_CLASSES': (
182         'rest_framework.authentication.SessionAuthentication',
183     ),
184     'PAGINATE_BY': 100,
185 }
186 
187 # URLs that end with slashes are ugly
188 APPEND_SLASH = False
189 
190 # A sample logging configuration. The only tangible logging
191 # performed by this configuration is to send an email to
192 # the site admins on every HTTP 500 error when DEBUG=False.
193 # See http://docs.djangoproject.com/en/dev/topics/logging for
194 # more details on how to customize your logging configuration.
195 LOGGING = {
196     'version': 1,
197     'disable_existing_loggers': False,
198     'filters': {
199         'require_debug_false': {
200             '()': 'django.utils.log.RequireDebugFalse'
201         }
202     },
203     'handlers': {
204         'mail_admins': {
205             'level': 'ERROR',
206             'filters': ['require_debug_false'],
207             'class': 'django.utils.log.AdminEmailHandler'
208         }
209     },
210     'loggers': {
211         'django.request': {
212             'handlers': ['mail_admins'],
213             'level': 'ERROR',
214             'propagate': True,
215         },
216     }
217 }
218 
219 # import deis-specific settings files
220 from .chef_settings import *  # @UnusedWildImport # noqa
221 from .celery_settings import *  # @UnusedWildImport # noqa
222 
223 # default deis settings
224 CONVERGE_ON_PUSH = True
225 DEIS_LOG_DIR = os.path.abspath(os.path.join(__file__, '..', '..', 'logs'))
226 LOG_LINES = 1000
227 
228 # Create a file named "local_settings.py" to contain sensitive settings data
229 # such as database configuration, admin email, or passwords and keys. It
230 # should also be used for any settings which differ between development
231 # and production.
232 # The local_settings.py file should *not* be checked in to version control.
233 # A local_setings.py configured for development might look like this:
234 #
235 # DEBUG = TEMPLATE_DEBUG = True
236 # ADMINS = (
237 #     ('Abraham Lincoln', 'abe@example.com'),
238 #     ('George Washington', 'george@example.com'),
239 # )
240 # DATABASES = {
241 #     'default': {
242 #         'ENGINE': 'django.db.backends.sqlite3',
243 #         'NAME': 'deis.db',
244 #         'USER': '',
245 #         'PASSWORD': '',
246 #         'HOST': '',
247 #         'PORT': '',
248 #     }
249 # }
250 # SECRET_KEY = 'CHANGEME_sapm$s%upvsw5l_zuy_&29rkywd^78ff(qilmw1#g'
251 # EMAIL_HOST = 'smtp.sendgrid.com'
252 # EMAIL_PORT = 587
253 # EMAIL_HOST_USER = 'foo'
254 # EMAIL_HOST_PASSWORD = 'bar'
255 
256 
257 try:
258     from .local_settings import *  # @UnusedWildImport # noqa
259 except ImportError:
260     print('\033[96mdeis/local_settings.py \033[91mfile not found!\033[0m')
261
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/deis/settings.py b/deis/settings.py
--- a/deis/settings.py
+++ b/deis/settings.py
@@ -195,12 +195,29 @@
 LOGGING = {
     'version': 1,
     'disable_existing_loggers': False,
+    'formatters': {
+        'verbose': {
+            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
+        },
+        'simple': {
+            'format': '%(levelname)s %(message)s'
+        },
+    },
     'filters': {
         'require_debug_false': {
             '()': 'django.utils.log.RequireDebugFalse'
         }
     },
     'handlers': {
+        'null': {
+            'level': 'DEBUG',
+            'class': 'logging.NullHandler',
+        },
+        'console': {
+            'level': 'DEBUG',
+            'class': 'logging.StreamHandler',
+            'formatter': 'simple'
+        },
         'mail_admins': {
             'level': 'ERROR',
             'filters': ['require_debug_false'],
@@ -208,9 +225,19 @@
         }
     },
     'loggers': {
+        'django': {
+            'handlers': ['null'],
+            'propagate': True,
+            'level': 'INFO',
+        },
         'django.request': {
-            'handlers': ['mail_admins'],
-            'level': 'ERROR',
+            'handlers': ['console', 'mail_admins'],
+            'level': 'WARNING',
+            'propagate': True,
+        },
+        'api': {
+            'handlers': ['console', 'mail_admins'],
+            'level': 'INFO',
             'propagate': True,
         },
     }

{"golden_diff": "diff --git a/deis/settings.py b/deis/settings.py\n--- a/deis/settings.py\n+++ b/deis/settings.py\n@@ -195,12 +195,29 @@\n LOGGING = {\n     'version': 1,\n     'disable_existing_loggers': False,\n+    'formatters': {\n+        'verbose': {\n+            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'\n+        },\n+        'simple': {\n+            'format': '%(levelname)s %(message)s'\n+        },\n+    },\n     'filters': {\n         'require_debug_false': {\n             '()': 'django.utils.log.RequireDebugFalse'\n         }\n     },\n     'handlers': {\n+        'null': {\n+            'level': 'DEBUG',\n+            'class': 'logging.NullHandler',\n+        },\n+        'console': {\n+            'level': 'DEBUG',\n+            'class': 'logging.StreamHandler',\n+            'formatter': 'simple'\n+        },\n         'mail_admins': {\n             'level': 'ERROR',\n             'filters': ['require_debug_false'],\n@@ -208,9 +225,19 @@\n         }\n     },\n     'loggers': {\n+        'django': {\n+            'handlers': ['null'],\n+            'propagate': True,\n+            'level': 'INFO',\n+        },\n         'django.request': {\n-            'handlers': ['mail_admins'],\n-            'level': 'ERROR',\n+            'handlers': ['console', 'mail_admins'],\n+            'level': 'WARNING',\n+            'propagate': True,\n+        },\n+        'api': {\n+            'handlers': ['console', 'mail_admins'],\n+            'level': 'INFO',\n             'propagate': True,\n         },\n     }\n", "issue": "500 errors should log stack trace by default\nRunning Django with DEBUG=True is too verbose (and bad practice), but we need to see errors when they occur.\n\nSee issue #77. \n\n", "before_files": [{"content": "\"\"\"\nDjango settings for the Deis project.\n\"\"\"\n\nfrom __future__ import unicode_literals\nimport os.path\n\n\nPROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\nADMINS = (\n    # ('Your Name', 'your_email@example.com'),\n)\n\nMANAGERS = ADMINS\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.',\n        'NAME': '',\n        'USER': '',\n        'PASSWORD': '',\n        'HOST': '',\n        'PORT': '',\n    }\n}\n\n# Hosts/domain names that are valid for this site; required if DEBUG is False\n# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts\nALLOWED_HOSTS = ['localhost']\n\n# Local time zone for this installation. Choices can be found here:\n# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name\n# although not all choices may be available on all operating systems.\n# In a Windows environment this must be set to your system time zone.\nTIME_ZONE = 'America/Denver'\n\n# Language code for this installation. All choices can be found here:\n# http://www.i18nguy.com/unicode/language-identifiers.html\nLANGUAGE_CODE = 'en-us'\n\nSITE_ID = 1\n\n# If you set this to False, Django will make some optimizations so as not\n# to load the internationalization machinery.\nUSE_I18N = True\n\n# If you set this to False, Django will not format dates, numbers and\n# calendars according to the current locale.\nUSE_L10N = True\n\n# If you set this to False, Django will not use timezone-aware datetimes.\nUSE_TZ = True\n\n# Absolute filesystem path to the directory that will hold user-uploaded files.\n# Example: \"/var/www/example.com/media/\"\nMEDIA_ROOT = ''\n\n# URL that handles the media served from MEDIA_ROOT. Make sure to use a\n# trailing slash.\n# Examples: \"http://example.com/media/\", \"http://media.example.com/\"\nMEDIA_URL = ''\n\n# Absolute path to the directory static files should be collected to.\n# Don't put anything in this directory yourself; store your static files\n# in apps' \"static/\" subdirectories and in STATICFILES_DIRS.\n# Example: \"/var/www/example.com/static/\"\nSTATIC_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', 'static'))\n\n# URL prefix for static files.\n# Example: \"http://example.com/static/\", \"http://static.example.com/\"\nSTATIC_URL = '/static/'\n\n# Additional locations of static files\nSTATICFILES_DIRS = (\n    # Put strings here, like \"/home/html/static\" or \"C:/www/django/static\".\n    # Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n)\n\n# List of finder classes that know how to find static files in\n# various locations.\nSTATICFILES_FINDERS = (\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n)\n\n# Make this unique, and don't share it with anybody.\nSECRET_KEY = None  # @UnusedVariable\n\n# List of callables that know how to import templates from various sources.\nTEMPLATE_LOADERS = (\n    'django.template.loaders.filesystem.Loader',\n    'django.template.loaders.app_directories.Loader',\n)\n\nTEMPLATE_CONTEXT_PROCESSORS = (\n    \"django.contrib.auth.context_processors.auth\",\n    \"django.core.context_processors.debug\",\n    \"django.core.context_processors.i18n\",\n    \"django.core.context_processors.media\",\n    \"django.core.context_processors.request\",\n    \"django.core.context_processors.static\",\n    \"django.core.context_processors.tz\",\n    \"django.contrib.messages.context_processors.messages\",\n    \"allauth.account.context_processors.account\",\n    \"allauth.socialaccount.context_processors.socialaccount\",\n)\n\nMIDDLEWARE_CLASSES = (\n    'django.middleware.common.CommonMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    # Uncomment the next line for simple clickjacking protection:\n    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n)\n\nROOT_URLCONF = 'deis.urls'\n\n# Python dotted path to the WSGI application used by Django's runserver.\nWSGI_APPLICATION = 'deis.wsgi.application'\n\nTEMPLATE_DIRS = (\n    # Put strings here, like \"/home/html/django_templates\"\n    # or \"C:/www/django/templates\".\n    # Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n    PROJECT_ROOT + '/web/templates',\n)\n\nINSTALLED_APPS = (\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.messages',\n    'django.contrib.sessions',\n    'django.contrib.sites',\n    'django.contrib.staticfiles',\n    # Third-party apps\n    'allauth',\n    'allauth.account',\n    'allauth.socialaccount',\n    'djcelery',\n    'json_field',\n    'rest_framework',\n    'south',\n    # Deis apps\n    'api',\n    'celerytasks',\n    'client',\n    'web',\n)\n\nAUTHENTICATION_BACKENDS = (\n    # Needed to login by username in Django admin, regardless of `allauth`\n    \"django.contrib.auth.backends.ModelBackend\",\n    # `allauth` specific authentication methods, such as login by e-mail\n    \"allauth.account.auth_backends.AuthenticationBackend\",\n)\n\nACCOUNT_EMAIL_REQUIRED = True\nACCOUNT_EMAIL_VERIFICATION = 'none'\nACCOUNT_LOGOUT_ON_GET = True\nACCOUNT_USERNAME_BLACKLIST = ['system']\nLOGIN_REDIRECT_URL = '/dashboard/'\n\n\nSOUTH_TESTS_MIGRATE = False\n\nREST_FRAMEWORK = {\n    'DEFAULT_MODEL_SERIALIZER_CLASS':\n    'rest_framework.serializers.ModelSerializer',\n    'DEFAULT_PERMISSION_CLASSES': (\n        'rest_framework.permissions.IsAuthenticated',\n    ),\n    'DEFAULT_AUTHENTICATION_CLASSES': (\n        'rest_framework.authentication.SessionAuthentication',\n    ),\n    'PAGINATE_BY': 100,\n}\n\n# URLs that end with slashes are ugly\nAPPEND_SLASH = False\n\n# A sample logging configuration. The only tangible logging\n# performed by this configuration is to send an email to\n# the site admins on every HTTP 500 error when DEBUG=False.\n# See http://docs.djangoproject.com/en/dev/topics/logging for\n# more details on how to customize your logging configuration.\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse'\n        }\n    },\n    'handlers': {\n        'mail_admins': {\n            'level': 'ERROR',\n            'filters': ['require_debug_false'],\n            'class': 'django.utils.log.AdminEmailHandler'\n        }\n    },\n    'loggers': {\n        'django.request': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': True,\n        },\n    }\n}\n\n# import deis-specific settings files\nfrom .chef_settings import *  # @UnusedWildImport # noqa\nfrom .celery_settings import *  # @UnusedWildImport # noqa\n\n# default deis settings\nCONVERGE_ON_PUSH = True\nDEIS_LOG_DIR = os.path.abspath(os.path.join(__file__, '..', '..', 'logs'))\nLOG_LINES = 1000\n\n# Create a file named \"local_settings.py\" to contain sensitive settings data\n# such as database configuration, admin email, or passwords and keys. It\n# should also be used for any settings which differ between development\n# and production.\n# The local_settings.py file should *not* be checked in to version control.\n# A local_setings.py configured for development might look like this:\n#\n# DEBUG = TEMPLATE_DEBUG = True\n# ADMINS = (\n#     ('Abraham Lincoln', 'abe@example.com'),\n#     ('George Washington', 'george@example.com'),\n# )\n# DATABASES = {\n#     'default': {\n#         'ENGINE': 'django.db.backends.sqlite3',\n#         'NAME': 'deis.db',\n#         'USER': '',\n#         'PASSWORD': '',\n#         'HOST': '',\n#         'PORT': '',\n#     }\n# }\n# SECRET_KEY = 'CHANGEME_sapm$s%upvsw5l_zuy_&29rkywd^78ff(qilmw1#g'\n# EMAIL_HOST = 'smtp.sendgrid.com'\n# EMAIL_PORT = 587\n# EMAIL_HOST_USER = 'foo'\n# EMAIL_HOST_PASSWORD = 'bar'\n\n\ntry:\n    from .local_settings import *  # @UnusedWildImport # noqa\nexcept ImportError:\n    print('\\033[96mdeis/local_settings.py \\033[91mfile not found!\\033[0m')\n", "path": "deis/settings.py"}], "after_files": [{"content": "\"\"\"\nDjango settings for the Deis project.\n\"\"\"\n\nfrom __future__ import unicode_literals\nimport os.path\n\n\nPROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\nADMINS = (\n    # ('Your Name', 'your_email@example.com'),\n)\n\nMANAGERS = ADMINS\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.',\n        'NAME': '',\n        'USER': '',\n        'PASSWORD': '',\n        'HOST': '',\n        'PORT': '',\n    }\n}\n\n# Hosts/domain names that are valid for this site; required if DEBUG is False\n# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts\nALLOWED_HOSTS = ['localhost']\n\n# Local time zone for this installation. Choices can be found here:\n# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name\n# although not all choices may be available on all operating systems.\n# In a Windows environment this must be set to your system time zone.\nTIME_ZONE = 'America/Denver'\n\n# Language code for this installation. All choices can be found here:\n# http://www.i18nguy.com/unicode/language-identifiers.html\nLANGUAGE_CODE = 'en-us'\n\nSITE_ID = 1\n\n# If you set this to False, Django will make some optimizations so as not\n# to load the internationalization machinery.\nUSE_I18N = True\n\n# If you set this to False, Django will not format dates, numbers and\n# calendars according to the current locale.\nUSE_L10N = True\n\n# If you set this to False, Django will not use timezone-aware datetimes.\nUSE_TZ = True\n\n# Absolute filesystem path to the directory that will hold user-uploaded files.\n# Example: \"/var/www/example.com/media/\"\nMEDIA_ROOT = ''\n\n# URL that handles the media served from MEDIA_ROOT. Make sure to use a\n# trailing slash.\n# Examples: \"http://example.com/media/\", \"http://media.example.com/\"\nMEDIA_URL = ''\n\n# Absolute path to the directory static files should be collected to.\n# Don't put anything in this directory yourself; store your static files\n# in apps' \"static/\" subdirectories and in STATICFILES_DIRS.\n# Example: \"/var/www/example.com/static/\"\nSTATIC_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', 'static'))\n\n# URL prefix for static files.\n# Example: \"http://example.com/static/\", \"http://static.example.com/\"\nSTATIC_URL = '/static/'\n\n# Additional locations of static files\nSTATICFILES_DIRS = (\n    # Put strings here, like \"/home/html/static\" or \"C:/www/django/static\".\n    # Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n)\n\n# List of finder classes that know how to find static files in\n# various locations.\nSTATICFILES_FINDERS = (\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n)\n\n# Make this unique, and don't share it with anybody.\nSECRET_KEY = None  # @UnusedVariable\n\n# List of callables that know how to import templates from various sources.\nTEMPLATE_LOADERS = (\n    'django.template.loaders.filesystem.Loader',\n    'django.template.loaders.app_directories.Loader',\n)\n\nTEMPLATE_CONTEXT_PROCESSORS = (\n    \"django.contrib.auth.context_processors.auth\",\n    \"django.core.context_processors.debug\",\n    \"django.core.context_processors.i18n\",\n    \"django.core.context_processors.media\",\n    \"django.core.context_processors.request\",\n    \"django.core.context_processors.static\",\n    \"django.core.context_processors.tz\",\n    \"django.contrib.messages.context_processors.messages\",\n    \"allauth.account.context_processors.account\",\n    \"allauth.socialaccount.context_processors.socialaccount\",\n)\n\nMIDDLEWARE_CLASSES = (\n    'django.middleware.common.CommonMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    # Uncomment the next line for simple clickjacking protection:\n    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n)\n\nROOT_URLCONF = 'deis.urls'\n\n# Python dotted path to the WSGI application used by Django's runserver.\nWSGI_APPLICATION = 'deis.wsgi.application'\n\nTEMPLATE_DIRS = (\n    # Put strings here, like \"/home/html/django_templates\"\n    # or \"C:/www/django/templates\".\n    # Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n    PROJECT_ROOT + '/web/templates',\n)\n\nINSTALLED_APPS = (\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.messages',\n    'django.contrib.sessions',\n    'django.contrib.sites',\n    'django.contrib.staticfiles',\n    # Third-party apps\n    'allauth',\n    'allauth.account',\n    'allauth.socialaccount',\n    'djcelery',\n    'json_field',\n    'rest_framework',\n    'south',\n    # Deis apps\n    'api',\n    'celerytasks',\n    'client',\n    'web',\n)\n\nAUTHENTICATION_BACKENDS = (\n    # Needed to login by username in Django admin, regardless of `allauth`\n    \"django.contrib.auth.backends.ModelBackend\",\n    # `allauth` specific authentication methods, such as login by e-mail\n    \"allauth.account.auth_backends.AuthenticationBackend\",\n)\n\nACCOUNT_EMAIL_REQUIRED = True\nACCOUNT_EMAIL_VERIFICATION = 'none'\nACCOUNT_LOGOUT_ON_GET = True\nACCOUNT_USERNAME_BLACKLIST = ['system']\nLOGIN_REDIRECT_URL = '/dashboard/'\n\n\nSOUTH_TESTS_MIGRATE = False\n\nREST_FRAMEWORK = {\n    'DEFAULT_MODEL_SERIALIZER_CLASS':\n    'rest_framework.serializers.ModelSerializer',\n    'DEFAULT_PERMISSION_CLASSES': (\n        'rest_framework.permissions.IsAuthenticated',\n    ),\n    'DEFAULT_AUTHENTICATION_CLASSES': (\n        'rest_framework.authentication.SessionAuthentication',\n    ),\n    'PAGINATE_BY': 100,\n}\n\n# URLs that end with slashes are ugly\nAPPEND_SLASH = False\n\n# A sample logging configuration. The only tangible logging\n# performed by this configuration is to send an email to\n# the site admins on every HTTP 500 error when DEBUG=False.\n# See http://docs.djangoproject.com/en/dev/topics/logging for\n# more details on how to customize your logging configuration.\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'formatters': {\n        'verbose': {\n            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'\n        },\n        'simple': {\n            'format': '%(levelname)s %(message)s'\n        },\n    },\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse'\n        }\n    },\n    'handlers': {\n        'null': {\n            'level': 'DEBUG',\n            'class': 'logging.NullHandler',\n        },\n        'console': {\n            'level': 'DEBUG',\n            'class': 'logging.StreamHandler',\n            'formatter': 'simple'\n        },\n        'mail_admins': {\n            'level': 'ERROR',\n            'filters': ['require_debug_false'],\n            'class': 'django.utils.log.AdminEmailHandler'\n        }\n    },\n    'loggers': {\n        'django': {\n            'handlers': ['null'],\n            'propagate': True,\n            'level': 'INFO',\n        },\n        'django.request': {\n            'handlers': ['console', 'mail_admins'],\n            'level': 'WARNING',\n            'propagate': True,\n        },\n        'api': {\n            'handlers': ['console', 'mail_admins'],\n            'level': 'INFO',\n            'propagate': True,\n        },\n    }\n}\n\n# import deis-specific settings files\nfrom .chef_settings import *  # @UnusedWildImport # noqa\nfrom .celery_settings import *  # @UnusedWildImport # noqa\n\n# default deis settings\nCONVERGE_ON_PUSH = True\nDEIS_LOG_DIR = os.path.abspath(os.path.join(__file__, '..', '..', 'logs'))\nLOG_LINES = 1000\n\n# Create a file named \"local_settings.py\" to contain sensitive settings data\n# such as database configuration, admin email, or passwords and keys. It\n# should also be used for any settings which differ between development\n# and production.\n# The local_settings.py file should *not* be checked in to version control.\n# A local_setings.py configured for development might look like this:\n#\n# DEBUG = TEMPLATE_DEBUG = True\n# ADMINS = (\n#     ('Abraham Lincoln', 'abe@example.com'),\n#     ('George Washington', 'george@example.com'),\n# )\n# DATABASES = {\n#     'default': {\n#         'ENGINE': 'django.db.backends.sqlite3',\n#         'NAME': 'deis.db',\n#         'USER': '',\n#         'PASSWORD': '',\n#         'HOST': '',\n#         'PORT': '',\n#     }\n# }\n# SECRET_KEY = 'CHANGEME_sapm$s%upvsw5l_zuy_&29rkywd^78ff(qilmw1#g'\n# EMAIL_HOST = 'smtp.sendgrid.com'\n# EMAIL_PORT = 587\n# EMAIL_HOST_USER = 'foo'\n# EMAIL_HOST_PASSWORD = 'bar'\n\n\ntry:\n    from .local_settings import *  # @UnusedWildImport # noqa\nexcept ImportError:\n    print('\\033[96mdeis/local_settings.py \\033[91mfile not found!\\033[0m')\n", "path": "deis/settings.py"}]}