I’m doing some django TDD samples following this article http://www.tdd-django-tutorial.com/tutorial/1/.
But when I try to run my testing I always got this problem,
Creating test database for alias 'default'...
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
return self.application(environ, start_response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
response = self.get_response(request)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in get_response
return super(StaticFilesHandler, self).get_response(request)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 153, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
return callback(request, **param_dict)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/views/defaults.py", line 32, in server_error
t = loader.get_template(template_name) # You need to create a 500.html template.
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/template/loader.py", line 145, in get_template
template, origin = find_template(template_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/template/loader.py", line 138, in find_template
raise TemplateDoesNotExist(name)
TemplateDoesNotExist: 500.html
I’ve tried Postgres and Sqlite3, the same output tortured me a lot.
Does anyone knows why I get this?
Thank you in advance.
The exception message states what went wrong.
It seems you are missing the
500.htmlfile from wherever django is looking for your templates. Make sure this file exists.I would assume that there is an internal error with your application, and Django is attempting to render it’s
500 Internal Server Errorpage, which is can’t find. There is probably an earlier exception that Django caught before this one happened.