Form validation fails due missing CSRF

前端 未结 4 725
忘了有多久
忘了有多久 2020-11-29 07:11

A few days ago I have reset my local flask environment without having captured the dependencies via a pip freeze before I deleted it. Hence I had to re-install

4条回答
  •  感动是毒
    2020-11-29 08:06

    At the time of creating the app:

    from flask_wtf.csrf import CsrfProtect
    
    csrf = CsrfProtect()
    
    app = Flask(__name__)   
    
    ...
    
    csrf.init_app(app)
    
    ...
    

提交回复
热议问题