Install the python3.5 flask framework and python3.5flask in the window.

Source: Internet
Author: User
Tags virtualenv

Install the python3.5 flask framework and python3.5flask in the window.

Steps:

1. python3.5 is installed on the local machine (the latest version 3.6 is installed, but cx_Oracle does not support it. Only 3.5 is supported and the version is changed)

2. Open the http://flask.pocoo.org/docs/0.12/installation,

(1) first download the get-pip.py file, and double-click to run the installation pip command

(2) Open cmd and run pip install -- upgrade pip setuptools to update the command.

(3) Open the python installation directory and enter/tools/scripts/win_add2path.py, Execute this file

(4) Open cmd and run pip install virtualenv to install virtualenv.

(5) Open cmd and run the command cd F: \ python \ pythonfile to enter the project directory folder.

(6) Open cmd and execute the command virtualenv venv to create a venv directory.

(7) Open cmd and execute the command venv \ Scripts \ activate to start the corresponding environment.

(8) Open cmd and run pip install Flask to install the flask framework.

Now install OK

3. Test

(1) Create fk. py

from flask import Flaskapp = Flask(__name__)@app.route('/')def hello_world():    return 'Hello, World!'

 

(2) run the set FLASK_APP = fk. py command.

Run the python-m flask run Command to display Running on http: // 127.0.0.1: 5000/

(3) open a browser and access http: // 127.0.0.1: 5000/. The browser displays Hello, World!

Successful

 

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.