FlaskWTFDeprecationWarning with Flask_Security

user6723321 picture user6723321 · Sep 30, 2016 · Viewed 7.1k times · Source

I am received a warning every time I use Flask Security.

FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" 
and will be removed in 1.0.

Is this an issue with Flask Security or something I could address myself? I am using Flask-Security==1.7.5

from flask_security import current_user, login_required, RoleMixin, Security, \
SQLAlchemyUserDatastore, UserMixin, utils

I don't seem to import Flask_WTF directly.

Answer

Billal Begueradj picture Billal Begueradj · Sep 12, 2017

My answer is not inherent to your exact situation. However, the same warning message occurs when we code this:

from flask_wtf import Form

To fix this problem, you should use FlaskForm in place of Form:

from flask_wtf import FlaskForm

This is highlighted on GitHub and I just want to share the solution here to help any eventual doer who might face it in the future.