7๐
I bumped into the same issue.
The answer was found here: https://github.com/jezdez/django_compressor/pull/206
The linkโs solution is doing handler500.
I decided to change 500.html template to avoid any {{STATIC_URL}} in it and the problem was solved.
1๐
It almost looks like STATIC_URL is not in your context. You do have the staticfiles contextprocessor configured, right? Have you tried to like the file without the compressor tags? Does {{ STATIC_URL }} show up correctly in the page when you load it?
I think compressor checks the url even if it accesses it through the file system looking at https://github.com/jezdez/django_compressor/blob/develop/compressor/base.py#L57
- [Django]-Django: Rest Framework authenticate header
- [Django]-Set Django IntegerField by choices=โฆ name
- [Django]-Django dump data for a single model?
1๐
This is an old question, but one of the few search results when searching for this error message, so it might be worth someting to share my solution.
In my case it was a dead simple case: I hardcoded my static url and forgot the /
at the beginning. So I had this:
<link type="text/css" rel="stylesheet" href="static/style.css" />
Which gave me the error. After changing to this:
<link type="text/css" rel="stylesheet" href="/static/style.css" />
It was fixed. Of course, I later realised, I should have used the setting STATIC_URL:
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}style.css" />
Hope this helps anyone.
- [Django]-How to add class, id, placeholder attributes to a field in django model forms
- [Django]-Handle `post_save` signal in celery
- [Django]-How to find out the request.session sessionid and use it as a variable in Django?
0๐
Iโve look at it some more and Iโm pretty sure the exception is caused by trying to display an uncatched error page without the full context the first pass had. This causes the exception in django-compressor.[1]
The solution, of course, is to handle all errors.
[1] Iโm also running some non-standard code to display static pages, maybe this interferes and the reason that the bug is not too common.
- [Django]-Creating email templates with Django
- [Django]-Simple Log to File example for django 1.3+
- [Django]-Getting TypeError: __init__() missing 1 required positional argument: 'on_delete' when trying to add parent table after child table with entries
0๐
I ran into the same issue; in my case the problem was caused by using COMPRESS_OFFLINE_CONTEXT
โ which does not .update()
the context but it replaces it altogether, thus removing STATIC_URL
.
The solution in my case was just adding it back to the COMPRESS_OFFLINE_CONTEXT
, after the local_settings import, otherwise any override there wouldnโt have worked.
- [Django]-ModuleNotFoundError: No module named 'grp' on windows
- [Django]-Django rest framework: set field-level error from serializer validate() method
- [Django]-Django: How to get language code in template?