comments = []
@app.route("/", methods=["GET", "POST"])
def index():
if request.method == "GET":
return render_template("index.html", comments=comments)
#如果是post:
comments.append(request.form["contents"])
return redirect(url_for('index'))
场景还原:我的服务器没开80端口,我用nginx
listen 81端口。利用flask框架(上述代码)遇到url_for('index')
定向到 xxx.cn。可是我需要定向到 xxx.cn:81,那么应该怎么写?
(手动访问xxx.cn:81都是可以的。)
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
根据文章http://www.cnblogs.com/kevingrace/p/8073646.html 尝试添加
proxy_redirect http://111111/ http://111111:81/;
,还是不行。。。