python 烧瓶 apache 导入

python flask apache import

你好,我想 运行 在 apache2 虚拟主机上使用 mod_wsgi

一个烧瓶应用程序

请看要点

如果我在 /srv/http/dashboard 中,我可以从 python 导入模块并使用 python 命令,然后从 SonntagDashboard 导入应用程序

https://gist.github.com/anonymous/0a22904852172526394f3da9c3feed8b

运行ning python3.6 和 manjaro (arch) 上的 apache 2.4 linux

您还没有告诉 mod_wsgi 您的项目代码在哪里。尝试更改为:

WSGIDaemonProcess dashboard python-path=/srv/http/dashboard

顺便说一句,不要使用:

DocumentRoot /srv/http/dashboard

如果您删除了 WSGIScriptAlias,人们就可以下载您的代码。切勿将 DocumentRoot 设置为您的应用程序代码所在的目录。保留它未设置以便选择 Apache 默认值,或创建一个空目录并设置 DocumentRoot 指向它。

您似乎也没有使用 Python 虚拟环境。确保您阅读: