【问题标题】:wsgi cant find modules in virtualenv in weblate + apache2 + wsgi setupwsgi 在 weblate + apache2 + wsgi 设置中找不到 virtualenv 中的模块
【发布时间】:2020-08-19 19:08:16
【问题描述】:

我让 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

【问题讨论】:

    标签: python-3.x apache virtualenv wsgi weblate


    【解决方案1】:

    原来示例配置错误,应该使用python-path而不是python-home代替WSGIDaemonProcess。我刚刚fixed this in Weblate,您可能也需要对配置进行此类更改。

    【讨论】:

      猜你喜欢
      • 2021-09-11
      • 1970-01-01
      • 2019-11-16
      • 2019-12-26
      • 2013-08-27
      • 1970-01-01
      • 1970-01-01
      • 2011-03-31
      • 2014-12-31
      相关资源
      最近更新 更多