2013-03-12 78 views
1

我试图在本地测试服务器上安装Django [我知道蟒蛇+ Django的有一]我已经设置了XAMPP托管:XAMPP + mod_wsgi的+蟒蛇的Windows 7

的Apache 2.4,Python 2.7版,mod_wsgi(从源代码编译:https://code.google.com/p/modwsgi/wiki/InstallationOnWindows并使用win32-ap22py27.mk,idk如果我使用的make文件没问题,因为启动apache时没有错误,而apache说它加载了wsgi模块以及我的python)

xampp

wsgi.conf [包含在httpd.conf中]:

WSGIScriptAlias /wsgi "C:/xampp/htdocs/wsgi/scripts/test.wsgi" 
AddHandler wsgi-script .wsgi 

<Directory "C:/xampp/htdocs/wsgi/scripts"> 
    Order deny,allow 
    Allow from all 
</Directory> 

和通用test.wsgi文件:

def application(env, start_response): 
    start_response("200 OK", []) 
    output = "<html>Hello World! Request: %s</html>" 
    output %= env['PATH_INFO'] 
    return [output] 

我的问题是,我得到的测试WSGI应用程序中止连接:**http://localhost/wsgi**

我已经搜查了互联网络并且没有运气

回答

0
This topic is useful for Windows 10, xampp webserver as well. 
I was struggling to find precompiled mod_wsgi.so for 
Apache/2.4.27 (Win32) 
Python/2.7.13 
This [link][1] is useful to find the appropriate version of mod_wsgi. 
IF you are lucky, you can find the precompiled version [here][1] 
There is a step by step guidance available [here][1] 

    enter code here 

    [1]: https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst 
    [2]: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi 
    [3]: https://everything2.com/title/Installing+Python+on+XAMPP 
+0

的推荐方法是建立它通过运行''pip install mod_wsgi''来完成。有关mod_wsgi,请参阅PyPi页面。 – 2017-09-15 13:39:42