django-pipeline icon indicating copy to clipboard operation
django-pipeline copied to clipboard

pipeline.middleware.MinifyHTMLMiddleware not working with Django 2.0.8

Open sowinski opened this issue 7 years ago • 2 comments

Hi,

I installed the latest version of django-pipeline==1.6.14 with Django 2.0.8 and get an exception while using pipeline.middleware.MinifyHTMLMiddleware.

File "/home/.3.5/site-packages/django/core/handlers/base.py", line 36, in load_middleware for middleware_path in reversed(settings.MIDDLEWARE): TypeError: argument to reversed() must be a sequence

Can someone confirm this bug?

Thx

sowinski avatar Oct 29 '18 15:10 sowinski

This error is not related to django-pipeline. Check your settings.py file for MIDDLEWARE definition, it should be a list of strings. e.g:


MIDDLEWARE = [
    'pipeline.middleware.MinifyHTMLMiddleware',
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
]

lejenome avatar Dec 05 '18 09:12 lejenome

It worked for me with Django 2.0.8 but now I updated to 2.1.15 and MinifyHTMLMiddleware breaks my code. It returns the output as a string.

Example: I see the correct output of my template, but it is returned as a string with b' my template as string'

sowinski avatar Jun 23 '20 13:06 sowinski