Quinto Labs Content Security 2 Django Error

So if you follow exactly the tutorial on integrating with apache you won’t get into any trouble. But if you don’t, and the line:

$sudo ./qlproxy_django/bin/easy_install django==1.3.1 lacks the version number or you’ve got previously a newer django version, you’ll get into an error like this:

ImportError at /
Import by filename is not supported.Request Method: GET
Request URL: http://hostname/
Django Version: 1.4
Exception Type: ImportError
Exception Value: Import by filename is not supported.
Exception Location: /var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/bin/python
Python Version: 2.6.6
Python Path: [‘/usr/local/lib/python2.6/dist-packages/virtualenv-1.7.2-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/pip-1.1-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/Django-1.4-py2.6.egg’,
‘/usr/lib/python2.6’,
‘/usr/lib/python2.6/plat-linux2’,
‘/usr/lib/python2.6/lib-tk’,
‘/usr/lib/python2.6/lib-old’,
‘/usr/lib/python2.6/lib-dynload’,
‘/usr/local/lib/python2.6/dist-packages’,
‘/usr/lib/python2.6/dist-packages’,
‘/usr/lib/pymodules/python2.6’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy/’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages’]

The error appear because you have a newer Django version than 1.3.1.

This error and a lot more information would appear only if you have DEBUG = True in your Django settings file.

Recovering from this is pretty simple:

 

#apt-get install httpd mod_wsgi python-setuptools
#easy_install virtualenv
#cd /var/opt/quintolabs/qlproxy/www
#virtualenv –no-site-packages qlproxy_django
#./qlproxy_django/bin/easy_install *django==1.3.1*

Got from here:

http://groups.google.com/group/quintolabs-content-security-for-squid-proxy/browse_frm/month/2012-04