0

我让 weblate 在开发模式下运行:8000。但是我无法在一切正常的虚拟环境中使用 wsgi 在 apache2 中运行它。

基于 apache 错误,它甚至找不到安装的 django。我这样做了,但看到了另一个缺少模块的错误。很明显,wsgi 不尊重/搜索 python 的 virtualenv 中的模块。

我的服务器是 Ubuntu 19.04。

请建议。

<VirtualHost *:80>
    ServerName xxyyzz.com

    # DATA_DIR/static/favicon.ico
    Alias /favicon.ico xxyyzz/weblate-env/lib/python3.7/site-packages/data/static/favicon.ico

    # DATA_DIR/static/
    Alias /static/ xxyyzz/weblate-env/lib/python3.7/site-packages/data/static/
    <Directory xxyyzz/weblate-env/lib/python3.7/site-packages/data/static/>
        Require all granted
    </Directory>

    # DATA_DIR/media/
    Alias /media/ xxyyzz/weblate-env/lib/python3.7/site-packages/data/media/
    <Directory /home/weblate/data/media/>
        Require all granted
    </Directory>

    # Path to your Weblate virtualenv
    WSGIDaemonProcess weblate python-path=xxyyzz/weblate-env
    WSGIProcessGroup weblate
    WSGIApplicationGroup weblate

    WSGIScriptAlias / xxyyzz/weblate-env/lib/python3.7/site-packages/weblate/wsgi.py process-group=weblate
    WSGIPassAuthorization On

    <Directory xxyyzz/weblate-env/lib/python3.7/site-packages/weblate/>
        <Files wsgi.py>
        Require all granted
        </Files>
    </Directory>

</VirtualHost>

同:https ://docs.weblate.org/en/latest/admin/install.html

4

1 回答 1

0

事实证明,示例配置是错误的,它应该使用python-path而不是python-homefor WSGIDaemonProcess。我刚刚在 Weblate 中修复了这个问题,您可能也需要在配置中进行此类更改。

于 2020-05-05T14:03:49.357 回答