main
模块¶
此文件是Web2py Web框架的一部分
版权所有:Massimo di Pierro<mdipierro@cs.depaul.edu>
许可证:lgplv3(http://www.gnu.org/licenses/lgpl.html)
Gluon WSGi应用程序¶
- class gluon.main.HttpServer(ip='127.0.0.1', port=8000, password='', pid_filename='httpserver.pid', log_filename='httpserver.log', profiler_dir=None, ssl_certificate=None, ssl_private_key=None, ssl_ca_certificate=None, min_threads=None, max_threads=None, server_name=None, request_queue_size=5, timeout=10, socket_timeout=1, shutdown_timeout=None, path=None, interfaces=None)[源代码]¶
基类:
object
Web2py Web服务器(Rocket)
- gluon.main.appfactory(wsgiapp=<function wsgibase>, logfilename='httpserver.log', profiler_dir=None, profilerfilename=None)[源代码]¶
生成执行日志记录和分析并调用wsgibase的wsgi应用程序
- 参数
wsgiapp -- 基本应用程序
logfilename -- 存储Apache兼容请求日志的位置
profiler_dir -- 存储配置文件的位置
- gluon.main.wsgibase(environ, responder)[源代码]¶
Gluon WSGi应用程序。请求页时调用的第一个函数(静态或动态)。它可以由paste.httpserver或apache mod_wsgi(或任何与wsgi兼容的服务器)调用。
用信息填充请求
环境变量,将“.”替换为“”
添加web2py路径和版本信息
补偿fcgi丢失的路径和查询字符串
验证URL中的路径
URL路径必须是:
对于静态页:
/<application>/static/<file>
对于动态页面:
/<application>[/<controller>[/<function>[/<sub>]]][.<extension>]
命名约定如下:
应用程序、控制器、函数和扩展只能包含 [a-zA-Z0-9_]
文件和子文件也可以包含“-”、“=”、“.”和“/”