So I upgraded from django 1.3 to 1.4, everything went smoothly. However a few users just get an Internal Server Error, thrown by nginx, usually when the server has crashed.
Investigating this showed that it was problems with cookies. The error in the log was:
ImproperlyConfigured: Error importing authentication backend
site.app.backends.EmailModelBackend: "No module named site.app.backends"
This is because during the upgrade I reorganized my project, and this particular backend is now at app.backends rather than site.app.backends. Clearly this information is hard-coded into the auth cookie, which is causing the problem.
Is there any way to sort this out short of emailing users and telling them to clear their cookies?
If you are using the default database-backed sessions, then the reference to the old backend is stored in the
django_sessiontable, and the user’s cookie is just a reference to the row in the database. In that case, you could prevent the errors by deleting all the session data from your database.Think carefully before you do this. You might not want to delete all your session data — for example, it will log out all of your users.