当前位置:网站首页>Actual combat | how to deploy flask project using wechat cloud hosting
Actual combat | how to deploy flask project using wechat cloud hosting
2022-06-24 06:35:00 【Tencent cloud development TCB】
One 、 Project introduction
This project uses flask Framework and Tencent cloud development cms Developed an official website of the company . Its main function is through requests request Development of cloud cms Data provided , Then render to the page .
Software architecture
- front end UI frame :layui
- Server side : flask
- Back end API: Development of cloud CMS
Two 、 Deployment project
Wechat cloud hosting deployment flask project
1. Let's start with this project clone To local ( Or download the compressed package directly ) https://github.com/hzjsj/flaskProject.git
2. visit Wechat cloud hosting official website , Create a cloud environment , Select the service list , And then create a new service
3. In the list of services , Click on the management , Go to the service details page , In the version list option, click new version
Here you can select the code library to pull , You need to empower your own github、gitlab perhaps gitlab, We need to code the project code just now , Upload to your git On the warehouse .
You can also choose to upload from local code , Enter the project root directory to compress the file , Upload compressed package . 4. After the new version status is normal , You can go there. Deployment of release Under Options , Publish the project
5. In the service list option , Click Service Details , You can see the public domain name , Copy to browser to open
6. There is a container loading process for the first access , It will be slow , After successful access, you can see the figure below
Here the project is deployed successfully , And the back end API It's a domain name , You need to install it yourself Development of cloud cms
Development of cloud cms Extended installation
1. Check the official documentation to install
https://docs.cloudbase.net/cms/install/extension.html
After successful installation , In the extended basic information option , You can see the access address and administrator account password
2. Access address , Log in backstage , Create a project
3. In the content model , Click Import model , Upload... In the root directory of the project flask-project.json file
4. In project setup , Configure access rights ( You need to go to the system settings first , Turn on API visit , And keep the configuration path )
5. In the root directory of the configuration project main.py file
headers = {
'Authorization': 'Bearer API_TOKEN'
}
api = ''Copy the access link above , Fill in api in , So that's configured , Finally, according to their own needs to add data .
You can also give API Set up Request authentication , take API_Token Modify the system created in Token
6. Local debugging , function main.py
http://localhost:8080
When the configuration is complete , Just re deploy the project
3、 ... and 、 Project summary
When using wechat cloud hosting , Pay attention to writing Dockerfile file , You can see Wechat cloud hosting official documents , Refer to the sample code for configuration Dockerfile file .
The related documents :
front end UI frame :https://www.layui.com/
flask file :https://dormousehole.readthedocs.io/en/latest/
Development of cloud CMS:https://docs.cloudbase.net/cms/intro.html
API Request document :https://docs.cloudbase.net/cms/usage/restful/intro.html#api-qing-qiu
Wechat cloud hosting :https://cloud.weixin.qq.com
Wechat cloud hosting document :https://developers.weixin.qq.com/miniprogram/dev/wxcloudrun/src/basic/guide.html
author : Wang xiulong, a Taoist priest in Yunkai
边栏推荐
- Risk management - Asset Discovery series - public web asset discovery
- Produce kubeconfig with permission control
- In the half year, there were 2.14 million paying users, a year-on-year increase of 62.5%, and New Oriental online launched its private domain
- Free and easy-to-use screen recording and video cutting tool sharing
- When easynvs is deployed on the project site, easynvr cannot view the corresponding channel. Troubleshooting
- Easycvr is cascaded to easygbs through gb28181 protocol. Notes on video channel failure
- Intranet environment request Tencent cloud 3.0 API details
- Web automated testing (2): choose selenium advantage? Comparison with phantomjs/qtp/monkey
- ServiceStack. Source code analysis of redis (connection and connection pool)
- 创客教育给教师发展带来的挑战
猜你喜欢
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database

目标5000万日活,Pwnk欲打造下一代年轻人的“迪士尼乐园”

基于三维GIS系统的智慧水库管理应用
Oracle case: ohasd crash on AIX

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing

云上本地化运营,东非第一大电商平台Kilimall的出海经

【二叉树】——二叉树中序遍历

ServiceStack. Source code analysis of redis (connection and connection pool)

【二叉数学习】—— 树的介绍

puzzle(019.1)Hook、Gear
随机推荐
Easy car Interviewer: talk about MySQL memory structure, index, cluster and underlying principle!
From home to Ali, a year for junior students to apply for jobs
WordPress pill applet build applet from zero to one [pagoda panel installation configuration]
DHCP server setup
Configure PHP development environment in MAC environment: apache+php+mysql
When the VPC main network card has multiple intranet IP addresses, the server cannot access the network internally, but the server can be accessed externally. How to solve this problem
What are the common network protocols
Innovating the security service mode, deeply convinced that the organization has been equipped with a "continuous online expert group"
Nine possibilities of high CPU utilization
Just now, we received a letter of thanks from Bohai University.
Analysis of official template of wechat personnel recruitment management system (I)
Royal treasure: an analysis of SQL algebra optimization
Station B collapsed. Let's talk to the injured programmers
Rhel8 series update image Yum source is Tencent cloud Yum source
What is the domain name query network and how it should be used
WordPress pill applet build applet from zero to one [pagoda panel environment installation]
Operation and maintenance dry goods | how to improve the business stability and continuity through fault recovery?
[fault announcement] one stored procedure brings down the entire database
In Tencent, my trial period summary
What I regret most when I learn programming!