Hello everyone,
My Django app started breaking all of a sudden and I cannot understand why. I can't even get it to run now. I'm running revision 11798.
When I use the stand-alone server to test my app, it suddenly started not importing csrf. I previously had it working perfectly. I tried to see what was up by using the shell and here was the result:
$ ./manage.py shell
Python 2.6.3 (r263:75184, Oct 2 2009, 07:56:03)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
>>> import django
>>> from django import middleware
>>> from django.middleware import csrf
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: cannot import name csrf
>>>
I checked the filesystem to see if the file was there and it was (and intact). I am horribly confused. Can anyone help me out?
The Django error follows:
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/servers/basehttp.py", line 279, in run
self.result = application(self.environ, self.start_response)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/servers/basehttp.py", line 651, in __call__
return self.application(environ, start_response)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/handlers/wsgi.py", line 230, in __call__
self.load_middleware()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/handlers/base.py", line 42, in load_middleware
raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
ImproperlyConfigured: Error importing middleware django.middleware.csrf: "No module named csrf"