What about change 4th and 6th lines? If session was renamed to test_session in the new version of django, it seems to be better solution to try import test_session first