window 搭建osqa 运行异常

阅读更多

 

  1. Sep 29

    Irfan Haider says:

    I got error when tried to run on Windows 7. Note that server is running without ...

    I got error when tried to run on Windows 7.
    Note that server is running without any issue.

    D:\osqa>manage.py runserver

    Validating models...

    0 errors found

    Django version 1.4.1, using settings 'osqa.settings'

    *Development server is running at http://127.0.0.1:8000/*

    Quit the server with CTRL-BREAK.

    Traceback (most recent call last):

      File "D:\Python27\lib\wsgiref\handlers.py", line 85, in run

        self.result = application(self.environ, self.start_response)

      File "D:\Python27\lib\site-packages\django-1.4.1-py2.7.egg\django\contrib\staticfiles\handlers.py", line 67, in _call_

        return self.application(environ, start_response)

      File "D:\Python27\lib\site-packages\django-1.4.1-py2.7.egg\django\core\handlers\wsgi.py", line 219, in _call_

        self.load_middleware()

      File "D:\Python27\lib\site-packages\django-1.4.1-py2.7.egg\django\core\handlers\base.py", line 51, in load_middleware

        raise exceptions.ImproperlyConfigured('Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname))

    ImproperlyConfigured: Middleware module "django.middleware.csrf" does not define a "CsrfResponseMiddleware" class

    [30/Sep/2012 02:16:52] "GET / HTTP/1.1" 500 59

    Traceback (most recent call last):

      File "D:\Python27\lib\wsgiref\handlers.py", line 85, in run

        self.result = application(self.environ, self.start_response)

      File "D:\Python27\lib\site-packages\django-1.4.1-py2.7.egg\django\contrib\staticfiles\handlers.py", line 67, in _call_

        return self.application(environ, start_response)

      File "D:\Python27\lib\site-packages\django-1.4.1-py2.7.egg\django\core\handlers\wsgi.py", line 219, in _call_

        self.load_middleware()

      File "D:\Python27\lib\site-packages\django-1.4.1-py2.7.egg\django\core\handlers\base.py", line 51, in load_middleware

        raise exceptions.ImproperlyConfigured('Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname))

    ImproperlyConfigured: Middleware module "django.middleware.csrf" does not define a "CsrfResponseMiddleware" class

    Solution:

    Use Django version 1.3.1 and now everything is working fine (OSQA is now running on my local machine)

    If you have installed latest version 1.4.x then you first you delete it and install version 1.3.1.

    1. From your python site-packages directory delete django-1.4.x-pyx.x.egg

      Example: D:\Python27\Lib\site-packages\django-1.4.2-py2.7.egg   

     

    2. Install Django version 1.3.1 with following command

     

     

    easy_install Django==1.3.1

     

你可能感兴趣的:(python,django)