How do you solve the error KeyError: 'A secret key is required to use CSRF.' when using a wtform in flask application?
问题 I have been trying to build a web app using flask and wtforms and a firebase database, but I keep getting the error message "KeyError: 'A secret key is required to use CSRF.'" and I don't know how to solve it. here is my code: from flask import Flask, render_template, request from firebase import firebase from flask_wtf import FlaskForm from flask_wtf.csrf import CSRFProtect, CSRFError from wtforms import DateField, StringField, TextAreaField from wtforms.validators import DataRequired from