Flask Publish
Flask Publish
go to your_ptoject/env/scripts at this path you will get an exe name activate run this in cmd
Install Libraries
install required libruaries by using pip command as below
<configuration>
<system.webServer>
<handlers>
</handlers>
<httpErrors errorMode="Detailed"/>
<asp scriptErrorSentToBrowser="true"/>
<security>
<requestFiltering>
<verbs>
</verbs>
</requestFiltering>
</security>
</system.webServer>
</configuration>
Installing IIS feature with CGI role
The Flask application connects with the FastCGI module of the server to expose the micro-service APIs. So, we have
to install the IIS feature in the Windows server and enable the CGI role. The following steps will help to do it:
Open Server Manager and select Manage > Add Roles and Features.
Click “Next” and select “Role-based or feature-based installation” and select “Next”
Accept the default configurations and continue till we see the “Role Services” screen. Select “CGI” under
“Application Development” and select “Next”
Accept the default configurations and select “Install”.
Enable wfastcgi
This should create an entry for FastCGI pointing to the wfastcgi module in IIS Server. Verify the entry under FastCGI
Settings in IIS Manager root server.
To host the Flask Application, we need to create a website using IIS Manager that can serve our application. Open
IIS Manager > Sites > Default Web Site (Default Web Site must display the FlaskApp folder).
Now, verify the module mapping in FastCGI Settings in the root server. This should create an entry in FastCGI
Settings.
Name: PYTHONPATH
Value: <Path_to_your_project>
The PYTHONPATH must point to the directory containing the Flask Application.
Name: WSGI_HANDLER
Value: main.app