网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

apache+mod_wsgi+django配置

在不完全明白之前,看别人的帖子总是觉得是错的,等到弄懂以后,怎么看都是对的。

正题:

创新互联建站坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都做网站、成都网站制作、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的高安网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

安装mod_wsgi,然后记得在http.conf文件里面添加以下一行:
LoadModule wsgi_module modules/mod_wsgi.so

此时的apache就是wsgi服务器了。也许有人会问什么是wsgi服务器。

# -*- coding: utf-8 -*- from wsgiref import simple_server def application(environ, start_response): status = \'200 OK\' output = \'Hello World!\' response_headers = [(\'Content-type\', \'text/plain\'), (\'Content-Length\', str(len(output)))] start_response(status, response_headers) return [output] # 下面两行就是简单的wsgi服务器 server = simple_server.make_server(\'localhost\', 8080, application) server.serve_forever()

注意这行:

server = simple_server.make_server(\'localhost\', 8080, application) 的参数application。这在apache里肯定无法编译进去,所以需要你在你的虚拟主机配置文件的
WSGIScriptAlias / /path/to/your/main.wsgi
行指出,而文件/path/to/your/main.wsgi的内容可能如下:

def application(environ, start_response): status = \'200 OK\' output = \'

Hello World!

\' response_headers = [(\'Content-type\', \'text/plain\'), (\'Content-Length\', str(len(output)))] start_response(status, response_headers) return [output] 或者
WSGIScriptAlias / /path/to/your/site/wsgi.py
然后wsgi.py就是django自动生成的文件。


网页名称:apache+mod_wsgi+django配置
文章起源:http://bjjierui.cn/article/cggpde.html

其他资讯