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