#14507 closed (fixed)
Static file serving is broken after rev 14293
Reported by: | Marco Bonetti | Owned by: | Jannis Leidel |
---|---|---|---|
Component: | Core (Other) | Version: | 1.2 |
Severity: | Keywords: | static, static_serve | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Attachments (1)
Change History (8)
by , 14 years ago
Attachment: | 14507.diff added |
---|
comment:1 by , 14 years ago
Has patch: | set |
---|
comment:2 by , 14 years ago
milestone: | → 1.3 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I created a Templatetag which renders an AuthenticationForm
on every page if the user is not logged in. The form uses context["request"]
which is passed to the Templatetag's render()
function. When I view the webpage on the development server with settings.DEBUG = False
the ImproperlyConfigured
exception is not raised as exptected. Instead, all the static files return the following traceback:
Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 281, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.6/dist-packages/django/contrib/staticfiles/handlers.py", line 57, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.6/dist-packages/django/contrib/staticfiles/handlers.py", line 57, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 253, in __call__ response = self.get_response(request) File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py", line 155, in get_response return self.handle_uncaught_exception(request, resolver, sys.exc_info()) File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py", line 193, in handle_uncaught_exception return callback(request, **param_dict) File "/usr/lib/python2.6/dist-packages/django/views/defaults.py", line 24, in server_error return http.HttpResponseServerError(t.render(Context({}))) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 173, in render return self._render(context) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 167, in _render return self.nodelist.render(context) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 796, in render bits.append(self.render_node(node, context)) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 809, in render_node return node.render(context) File "/usr/lib/python2.6/dist-packages/django/template/loader_tags.py", line 125, in render return compiled_parent._render(context) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 167, in _render return self.nodelist.render(context) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 796, in render bits.append(self.render_node(node, context)) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 809, in render_node return node.render(context) File "/usr/lib/python2.6/dist-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 796, in render bits.append(self.render_node(node, context)) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 809, in render_node return node.render(context) File "/usr/lib/python2.6/dist-packages/django/template/defaulttags.py", line 258, in render return self.nodelist_true.render(context) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 796, in render bits.append(self.render_node(node, context)) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 809, in render_node return node.render(context) File "/usr/lib/python2.6/dist-packages/django/template/defaulttags.py", line 260, in render return self.nodelist_false.render(context) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 796, in render bits.append(self.render_node(node, context)) File "/usr/lib/python2.6/dist-packages/django/template/__init__.py", line 809, in render_node return node.render(context) File "/home/jannis/Projekte/[…]/templatetags/loginform.py", line 15, in render request = context["request"] File "/usr/lib/python2.6/dist-packages/django/template/context.py", line 46, in __getitem__ raise KeyError(key) KeyError: 'request'
comment:5 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
please don't reopen unrelated tickets.
The error you are seeing has nothing to do with static files and is not a bug - you are missing debug context_processor and the checks for valid configurations aren't run in production mode.
comment:6 by , 14 years ago
I'm sorry for reopening the ticket. It seemed apropriate as this behaviour has nothing to do with a missing context_processor but with this specific commit. All previous commits work fine and following commits cause a KeyError rather than an ImproperlyConfigured Exception which is what this Changeset was about, no?
Sorry again.
Patch to fix