【问题标题】:MkDocs deploy with python on gunicornMkDocs 在 gunicorn 上使用 python 部署
【发布时间】:2016-04-20 02:30:52
【问题描述】:

请大家帮帮我吧!

我在 nginx 和 gunicorn 中使用我现有的 python 项目部署 MkDocs 有一个问题。

问题是:

If I use python run.py it's working fine, but I use supervisor gunicorn it's not work.

Python 脚本:

docs = os.path.join(os.path.dirname(os.path.abspath(__file__)), "site")

@app.route('/app/docs/', methods=['GET'])
@app.route('/app/docs/<path:path>', methods=['GET'], defaults={'path': None})
@app.route('/app/docs/<path:path>', methods=['GET'])
def static_proxy(path=''):
    if path[-3:] not in ['css', '.js', 'png']:
        path = os.path.join(path,'index.html')

    return send_from_directory(docs, path)

有什么帮助吗?

【问题讨论】:

    标签: python gunicorn supervisord mkdocs


    【解决方案1】:

    现在已修复。哈哈。

    在我将此脚本放入run.py 之前,它对@app.route('app/docs') 没有影响,然后我将其移至其他文件.py 它运行良好!

    【讨论】:

      猜你喜欢
      • 2020-04-06
      • 2017-04-13
      • 1970-01-01
      • 2016-03-19
      • 2021-12-14
      • 2012-08-22
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      相关资源
      最近更新 更多