Deploying Flask to Linux Servers

Source: Internet
Author: User

In the previous article, we introduced the operating environment of building Nginx+uwsgi+flask in CentOS, and this section describes how to deploy our flask project to the environment.

1. upload flask Project

Download WINSCP Tools

https://winscp.net/eng/download.php

The installation process is relatively simple, not to repeat.

After the installation is complete, open the WinSCP interface, create a new remote connection,

Click "Login" to pop up the confirmation screen

Click "Yes", after the successful connection, you can see the left is the local file system, the right is the server's file system.

Locate the deployment path for our server application (/www/) and upload the local project to the directory:

After dragging

2. Modify the Uwsgi.ini configuration

View the Uwsgi.ini configuration file to see the boot files of the flask that we configured earlier

Change this file to code.py.

Save exit.

3. Reload uwsgi service

Uwsgi--reload Uwsgi/uwsgi.pid

4. Access to the project

Visit http://172.20.10.11

The page has become the content defined in our code.py

Deploying Flask to Linux Servers

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.