#29100: Give useful feedback to developer if a bad url is used for a static file
------------------------------------------------+------------------------
Reporter: Håkan Lövdahl | Owner: nobody
Type: Bug | Status: new
Component: File uploads/storage | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
in django/core/handlers/base.py there is a problem.
Sometimes when using the statichandler it throws an exception without any
useful information.
I would like to propose an update the BaseHandler class
{{{#!python
def get_response(self, request):
"""Return an HttpResponse object for the given HttpRequest."""
# Setup default url resolver for this thread
set_urlconf(settings.ROOT_URLCONF)
if self._middleware_chain is None:
if self.__class__.__name__ == 'StaticFilesHandler':
uri = '%s' % (request.get_full_path() )
raise ValueError('Bad path for static file: %s' % uri)
}}}
This would help for keeping the test-outputs nice and clean.
--
Ticket URL: <https://code.djangoproject.com/ticket/29100>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.ed1bec686f8d049ef47ba0410b4c1c02%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.