[英]Flask:Expected an indented block
所以我的燒瓶應用程序出現錯誤,提示:
File app.py, line 13
first = request.form.get('first')
IndentationError: expected an indented block
這是我的app.py代碼
import time
import requests
import requests_cache
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def home():
if request.method == 'POST':
first = request.form.get('first')
url = "http://myAPIURL.com/ws/spm/search/perfid/{0}".format(first)
response = requests.get(url)
return jsonify(response.json())
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)
我檢查了縮進,對我來說似乎很好,
有人可以指出我做錯了嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.