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