国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

阿里云函數(shù)制作靜態(tài)web頁面

2022-09-07 22:50 作者:限量版范兒  | 我要投稿

1、登陸賬號,進(jìn)入到函數(shù)計算控制臺https://fc.console.aliyun.com/fc/ 選擇要創(chuàng)建函數(shù)的所在區(qū)域

2、點擊左側(cè)服務(wù)及函數(shù)后創(chuàng)建服務(wù),新增函數(shù),選擇flask-web模版進(jìn)行創(chuàng)建,并選擇http觸發(fā)器

?

?3、進(jìn)入函數(shù),選擇代碼執(zhí)行

?

?4、右擊點擊創(chuàng)建文件,創(chuàng)建index.html文件(可用word另存為進(jìn)行生成

?

?5、修改main.py文件

#!/usr/bin/env python # coding=utf-8from flask import Flask,send_filefrom flask import request from flask import make_response try: ?from urllib.parse import urlparse except: ?from urlparse import urlparse app = Flask(__name__) base_path = '' @app.route('/', methods=['GET', 'POST'])def home(): # ? ?resp = make_response('<h3>home<h3>', 200) ? ?return send_file("index.html")@app.route('/signin', methods=['GET']) def signin_form(): ? ?global base_path ? ?html = '''<form action="{}/signin" method="post"> ? ? ? ? <p><input name="username"></p> ? ? ? ? <p><input name="password" type="password"></p> ? ? ? ? <p><button type="submit">Sign In</button></p> ? ? ? ? </form>'''.format(base_path) ? ?resp = make_response(html, 200) ? ?return resp @app.route('/signin', methods=['POST']) def signin(): ? ?if request.form['username']=='admin' and request.form['password']=='password': ? ? ? ?html = '<h3>Hello, admin!</h3>' ? ?else: ? ? ? ?html = '<h3>Bad username or password.</h3>' ? ?resp = make_response(html, 200) ? ?return resp def handler(environ, start_response): ? ?parsed_tuple = urlparse(environ['fc.request_uri']) ? ?li = parsed_tuple.path.split('/') ? ?global base_path ? ?if not base_path: ? ? ? ?base_path = "/".join(li[0:5]) ? ?return app(environ, start_response)

點擊右上角部署,自定義域名后即可訪問

鏈接:https://www.dianjilingqu.com/523787.html

阿里云函數(shù)制作靜態(tài)web頁面的評論 (共 條)

分享到微博請遵守國家法律
丽水市| 文登市| 西平县| 皋兰县| 运城市| 土默特右旗| 民勤县| 和田市| 宁化县| 灌南县| 伊金霍洛旗| 民权县| 松阳县| 榕江县| 长沙县| 穆棱市| 哈尔滨市| 井陉县| 芮城县| 深水埗区| 罗甸县| 临邑县| 卢龙县| 广东省| 孙吴县| 凤翔县| 宜阳县| 隆林| 嘉禾县| 长治县| 潜江市| 枝江市| 手游| 高青县| 哈密市| 惠安县| 贵州省| 沁水县| 阿勒泰市| 莱州市| 宣汉县|