部署到 IIS 时出现 Flask 权限错误 [英] Flask Permission Error when deployed to IIS

查看:62
本文介绍了部署到 IIS 时出现 Flask 权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 FastCGI 和 WSGI 处理程序将 Flask 应用程序部署到 IIS.我遵循的步骤是

  1. 为 Python 创建了一个虚拟环境并安装了包括 wfastCGI 在内的所有软件包.
  2. 设置处理程序映射并包含 FastCGI 设置.
  3. 通过添加 IIS_IUSRS 和 IUSR 为文件夹分配必要的权限.

以下是我在步骤方面遵循的中等链接.

快速 CGI 设置如下所示,WSGI Handler 为 checkFlask.app

生成的 web.config 文件在这里.

当我尝试在端口 80、5000 上运行时,我收到与 System32 相关的权限错误,对此我感到非常困惑和不确定.任何想法或意见都受到高度赞赏.谢谢.

解决方案

问题在于 checkFlask.py 文件中的一些库,其中包括 IPython.display.删除这些库后,代码运行良好.暂时将此标记为已解决.这是我找到的解决方案的参考链接.https://community.esri.com/t5/python-questions/are-wfastcgi-python-api-compatible/mp/76578#M6215

I deployed a flask app to IIS using FastCGI and WSGI Handler. The steps that I have followed are

  1. Created a virtual environment for Python and installed all packages including wfastCGI.
  2. Set the Handler mappings and included the FastCGI settings.
  3. Assigned the necessary permissions for the folders by adding IIS_IUSRS and IUSR.

Below is the medium link that I followed in terms of the steps. https://medium.com/@dpralay07/deploy-a-python-flask-application-in-iis-server-and-run-on-machine-ip-address-ddb81df8edf3

The folder structure for the code is as shown below with (checkin_env) being the virtual environment.

Fast CGI settings are shown as below with WSGI Handler being checkFlask.app

The web.config file which was generated is here.

When I tried running on Ports 80, 5000 I received a permission error related to System32 which I am totally confused and unsure about. Any thoughts or inputs are highly appreciated. Thank you.

解决方案

The issue was with some libraries inside the checkFlask.py file which included IPython.display. Code worked fine after removing those libraries. Marking this as resolved for now. Here is a reference link for the solution I found. https://community.esri.com/t5/python-questions/are-wfastcgi-python-api-compatible/m-p/76578#M6215

这篇关于部署到 IIS 时出现 Flask 权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆