How do you solve the error KeyError: 'A secret key is required to use CSRF.' when using a wtform in flask application?

后端 未结 3 511
借酒劲吻你
借酒劲吻你 2021-02-05 02:59

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.\'

3条回答
  •  耶瑟儿~
    2021-02-05 03:58

    Add this line to your app code:

    app.config['SECRET_KEY'] = 'any secret string'
    

提交回复
热议问题