I am using Django 1.8.2 on Python 3.4.2.
I have added the appropriate middleware classes and set HTML_MINIFY = True in order to test it while having DEBUG on.
When I run my development server, I get a "NameError" type of error, with the message "name 'unicode' is not defined".
Exception Value:
name 'unicode' is not defined
Exception Location: /Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/htmlmin/minify.py in html_minify, line 43
Python Executable: /Users/drcooldude/Desktop/testproject/env/bin/python
Traceback:
File "/Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
223. response = middleware_method(request, response)
File "/Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/htmlmin/middleware.py" in process_response
44. parser=parser)
File "/Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/htmlmin/minify.py" in html_minify
43. return unicode(mini_soup)
According to my traceback, the error is located in minify.py at line 43.
Found out that the error is because of incompatibility with Python 3. There is currently a pull request open that should fix it, but it's more than a year old: #72
I am using Django 1.8.2 on Python 3.4.2. I have added the appropriate middleware classes and set
HTML_MINIFY = True
in order to test it while having DEBUG on.When I run my development server, I get a "NameError" type of error, with the message "name 'unicode' is not defined".
According to my traceback, the error is located in minify.py at line 43.