ImproperlyConfigured: Error importing middleware django.middleware.csrf: "No module named csrf"

341 views
Skip to first unread message

vl4dt

unread,
Oct 30, 2009, 9:04:09 PM10/30/09
to Django developers
I get this output from a newly created project with the latest trunk:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):

File "E:\Python26\lib\site-packages\django\core\servers
\basehttp.py", line 279, in run
self.result = application(self.environ, self.start_response)

File "E:\Python26\lib\site-packages\django\core\servers
\basehttp.py", line 651, in __call__
return self.application(environ, start_response)

File "E:\Python26\lib\site-packages\django\core\handlers\wsgi.py",
line 230, in __call__
self.load_middleware()

File "E:\Python26\lib\site-packages\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"
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Any suggestions? I suspect the python path is missing something, also
the server stops responding, just sits there and no further requests
are served.

Luke Plant

unread,
Oct 31, 2009, 10:42:02 AM10/31/09
to django-d...@googlegroups.com
On Saturday 31 October 2009 01:04:09 vl4dt wrote:
> I get this output from a newly created project with the latest
> trunk:
>
<snip>

>
> Any suggestions? I suspect the python path is missing something,
> also the server stops responding, just sits there and no further
> requests are served.

I started a new project in the normal way, and it works fine for me.
It sounds like you've configured something wrong, or you're not
actually looking at latest trunk. Maybe your command to start the
project used a 'django-admin.py' that was from trunk, but when running
the server it's looking at different Python sources.

Luke

Reply all
Reply to author
Forward
0 new messages