我有一个烧瓶应用程序,我可以部署在aws使用Zappa。简单的Hello运行良好,但是当我的应用程序重定向到uri (不包括环境名称(/uri而不是/dev/uri) )时,我会得到一个禁止的错误。
app.route("/")
def home():
return render_template('index.html')
@app.route("/upload", methods=['GET','POST'])
def upload():
if request.method == "POST":
f = request.files['file']
f.save(os.path.join(UPLOAD_FOLDER, secure_filename(f.filename)))
upload_file(f"uploads/{f.filename}", BUCKET)
return redirect("/") 上述上载方法在访问时失败,给出了一个{"message":"Forbidden"}错误。
我认为它必须在URI不正确的情况下做一些事情,因为Zappa在部署期间添加了“dev”路径。
发布于 2021-10-02 00:44:01
开发人员多次表示,需要使用域名来克服添加"/dev“和"/production”的问题。你可以试着跟踪这个页面上的内容。
https://stackoverflow.com/questions/69413084
复制相似问题