Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to host in Windows IIS 10.0? #27

Open
Raj9417 opened this issue Dec 7, 2020 · 0 comments
Open

How to host in Windows IIS 10.0? #27

Raj9417 opened this issue Dec 7, 2020 · 0 comments

Comments

@Raj9417
Copy link

Raj9417 commented Dec 7, 2020

I have manage simple flask app on windows IIS and it works. Sample web.config of normal flask app that work:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <modules>
            <remove name="WebDAVModule" />
        </modules>
        <handlers>
            <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" 
            scriptProcessor="C:\Users\Vimalraj\AppData\Local\Programs\Python\Python36\python.exe|C:\Users\Vimalraj\AppData\Local\Programs\Python\Python36\Lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
        </handlers>
            <directoryBrowse enabled="true" />
    </system.webServer>
    <appSettings>
        <add key="WSGI_HANDLER" value="myapp2.manager" />
        <add key="PYTHONPATH" value="C:\API\facemaskapi\" />
    </appSettings>
</configuration>

But when I try with this flask-restplus-boilerplate it is not working. The web.config of the not working flask app:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <modules>
            <remove name="WebDAVModule" />
        </modules>
        <handlers>
            <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" 
            scriptProcessor="C:\Users\Vimalraj\AppData\Local\Programs\Python\Python36\python.exe|C:\Users\Vimalraj\AppData\Local\Programs\Python\Python36\Lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
        </handlers>
            <directoryBrowse enabled="true" />
    </system.webServer>
    <appSettings>
        <add key="WSGI_HANDLER" value="manage.manager" />
        <add key="PYTHONPATH" value="C:\RESTFULAPI\API\" />
    </appSettings>
</configuration>

For the working version, the script name is "myapp2.py" and have "manager= Flask(name)" thus the WSGI_HANDLER value is "myapp2.manager".

I am not sure what should I put on the web.config of the not working version, currently the value is "manage.manager" where the script name is "manage.py" and I suspect "manager" is the startup line in the code.

My main line is as below:

if name == 'main':
manager.run(default_command="run")

run command as below:

@manager.command
def run():
app.run(host='127.0.0.1',port=7071)

Please help me in this Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant