How to upload and display image

**> **i try to upload and display image on my template html when i upload image i have success but when i want to display image, server saying

"get static 404" anyone help me?

views.py @app.route("/upload/", methods=['GET', 'POST']) @login_required def upload(username): form = PhotoForm() user =

User.query.filter_by(username=username).first()
if request.method == 'POST' and form.validate_on_submit():
f = form.photo.data
filename = secure_filename(f.filename) f.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
return redirect(url_for ('user', username=user.username, filename=filename, f=f)) return render_template("change_profile_picture.html", form=form)

user.html ****

链接地址: http://www.djcxy.com/p/71906.html

上一篇: 从ajax获取张贴的数据到瓶服务器并显示模板

下一篇: 如何上传和显示图像