为了配置基于 mod_python 的 django,首先要安装有可用的 mod_python 模块的 apache。 这通常意味着应该有一个 loadmodule 指令在 apache 配置文件中。 它看起来就像是这样:
LoadModule python_module /usr/lib/apache2/modules/mod_python.so
Then, edit your Apache configuration file and add a
<Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonDebug Off </Location>
要确保把 DJANGO_SETTINGS_MODULE 中的 mysite.settings 项目换成与你的站点相应的内容。
它告诉 Apache,任何在 / 这个路径之后的 URL 都使用 Django 的 mod_python 来处理。 它 将 DJANGO_SETTINGS_MODULE 的值传递过去,使得 mod_python 知道这时应该使用哪个配置。
注意这里使用 ```` 指令而不是 ```` 。 后者用于指向你的文件系统中的一个位置,然而 ````
System Message: WARNING/2 (<string>, line 403); backlink Inline literal start-string without end-string. System Message: WARNING/2 (<string>, line 403); backlink Inline literal start-string without end-string. System Message: WARNING/2 (<string>, line 403); backlink Inline literal start-string without end-string. System Message: WARNING/2 (<string>, line 403); backlink Inline literal start-string without end-string. System Message: ERROR/3 (<string>, line 405) Unexpected indentation.
指向一个 Web 站点的 URL 位置。 ````
hdhcms网站支持PC、手机版,同时后台支持公众号的接入,包括微信服务号订阅号,可以设置自动回复及服务号菜单及认证订阅号菜单。 1、网站上线方法: 1.1本网站运行环境为:IIS6.5+SQLITE 1.2将网站解压到网站目录 1.3数据库默认为SQLITE,包括在解压目录内,无须修改 1.4 完成上面的配置后通过所绑定的域名即可运行2网址访问及后台访问配置
0
System Message: WARNING/2 (<string>, line 405); backlink Inline literal start-string without end-string. System Message: WARNING/2 (<string>, line 405); backlink Inline literal start-string without end-string.
Apache 可能不但会运行在你正常登录的环境中,也会运行在其它不同的用户环境中;也可能会有不同的文件路径或 sys.path。 你需要告诉 mod_python 如何去寻找你的项目及 Django 的位置。
PythonPath "['/path/to/project', '/path/to/django'] + sys.path"
你也可以加入一些其它指令,比如 PythonAutoReload Off 以提升性能。 查看 mod_python 文档获得详细的指令列表。
注意,你应该在成品服务器上设置 PythonDebug Off 。如果你使用 PythonDebug On 的话,在程序产生错误时,你的用户会看到难看的(并且是暴露的) Python 回溯信息。 如果你把 PythonDebug 置 On,当mod_python出现某些错误,你的用户会看到丑陋的(也会暴露某些信息)Python的对错误的追踪的信息。
重启 Apache 之后所有对你的站点的请求(或者是当你用了
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号