Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem using html_minify in django #147

Open
chrisamow opened this issue Dec 16, 2020 · 0 comments
Open

problem using html_minify in django #147

chrisamow opened this issue Dec 16, 2020 · 0 comments

Comments

@chrisamow
Copy link

Hi, thank you for doing this project!

I am trying to manually minify a view in a django project, but I don't have it integrated to the middleware (other views are already taken care of and have a build process)
But I expected to be able to call html_minify on the output of a call to django.shortcuts.render.
Instead I get:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/site-packages/debug_toolbar/middleware.py", line 67, in __call__
    panel.generate_stats(request, response)
  File "/usr/local/lib/python3.8/site-packages/debug_toolbar/panels/headers.py", line 53, in generate_stats
    self.response_headers = OrderedDict(sorted(response.items()))

Exception Type: AttributeError at /v/27/
Exception Value: 'str' object has no attribute 'items'

Maybe there is something in newer django? Or is there some intermediate step in this possibly unusal workflow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant