@app.route("/admin/settings", methods=["GET", "POST"]) def admin_settings(): cssform = AdminCssForm() if cssform.validate_on_submit(): set_setting(id = 'usercss', value=cssform.cssdata.data) return render_template("admin_settings.html", cssform=cssform) ==== CHAGNED TO ==== @app.route("/admin/settings", methods=["GET", "POST"]) def admin_settings(): cssform = None cssform = AdminCssForm() if cssform.validate_on_submit(): set_setting(id = 'usercss', value=cssform.cssdata.data) return render_template("admin_settings.html", cssform=cssform)