Windows 10 Deployment Flask Web

Source: Internet
Author: User

Cause

I was going to use Django to write a Web application that manages MongoDB data easily. As a result Django does not directly support MongoDB ... There's no time to study nosql. So think about the entire API ...

So first use flask to do a simple demo deployment to the local test water

A simple Demo
From flask import flask, Jsonifyapp = Flask (__name__) tasks = [    {        ' id ': 1,        ' title ': U ' Buy groceries ',        ' des Cription ': U ' Milk, Cheese, Pizza, Fruit, Tylenol ',        ' done ': False    },    {        ' id ': 2,        ' title ': U ' learn Python ',        ' description ': U ' need to find a good Python tutorial on the Web ',        ' done ': False    }] @app. Route ('/') d EF Hello_world ():    return jsonify ({' Task ': Tasks}) if __name__ = = ' __main__ ':    app.run ()
Into the pit of deployment

A variety of online deployment blog ... All kinds of reprint ... http://python.jobbole.com/87655/learn from it.

  • Installing IIS
  • Enable CGI
  • Install Microsoft Web Platform Installer
  • Add URL rewrite (URL Rewrite) and IIS (CGI)
  • Install wfastcgi (pip install wfastcgi)
  • Enable wfastcgi

  • create Web. config
    <?xml version= "1.0" encoding= "Utf-8"?><configuration> <system.webServer>   <!--name and path are the project names; ScriptProcessor is the return information of the wfastcgi (for example, the Draw line section)--><add name= "DMApi" path= "DMApi" verb= "*" Modules= "Fastcgimodule" scriptprocessor= "e:\demo\flask\dmapi\venv\scripts\python36.exe|e:\demo\flask\dmapi\venv      \lib\site-packages\wfastcgi.py "resourcetype=" File "/> <!--scriptprocessor value from command-line tool wfastcgi-enable- <add name= "flaskfastcgi" path= "*" verb= "*" modules= "Fastcgimodule" scriptprocessor= "e:\demo\flask\dmapi\venv\ scripts\python36.exe|e:\demo\flask\dmapi\venv\lib\site-packages\wfastcgi.py "resourceType=" Unspecified " requireaccess= "Script"/> 
  • Configuring IIS directories and Permissions
  • Create a Web site
Access to the Pit

The good "Hello ..." is written in the tutorial.

And I was like this.

Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

That is true......

Results

This error occurs when there was a problem reading the configuration file for the Web server or Web application. In some cases, the event logs could contain more information on what's caused this error.

ADD application development from the features! Remember to add the 4.5 stuff if you need it

The solution is to install ASP.

Finally saw the result ...

Windows 10 Deployment Flask Web

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.