Category Archives: django

ImportError: cannot import name sanitizer when trying to run django

I hope this saves you a couple hours of headaches that I experienced recently. If you get the dreaded error: from html5lib import sanitizer, serializer, treebuilders, treewalkers ImportError: cannot import name sanitizer Never fear. The fix is easy once you … Continue reading

Posted in django, python, Web Programming | Comments Off on ImportError: cannot import name sanitizer when trying to run django

KeyError: ‘en-us’ when doing a reverse() lookup in urls.py

If you’re getting an error like this: … in reverse_dict return self._reverse_dict[language_code] KeyError: ‘en-us’ If your urls.py file contains a reverse() call, that is the reason.  You’re calling reverse before all the urls are loaded and everything is ready.  You … Continue reading

Posted in django, python, Web Programming | Comments Off on KeyError: ‘en-us’ when doing a reverse() lookup in urls.py

Password reset template not working in django — admin password reset comes up instead

This was a real head scratcher. Not sure exactly why but, of all the templates used by django-registration, this one template has an issue. But it does. registration/password_reset_form.html For some reason, the admin password reset form comes up instead of … Continue reading

Posted in django | Comments Off on Password reset template not working in django — admin password reset comes up instead

ImportError: cannot import name utils

If you get an error like this: File “python/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py”, line 9, in <module> from django.db import utils ImportError: cannot import name utils You need to install psycopg2.  You will also probably need to apt-get install build-essential libpq-dev

Posted in django, python | Comments Off on ImportError: cannot import name utils