FlaskWTFDeprecationWarning with Flask_Security
<p>I am received a warning every time I use Flask Security.</p>

<pre><code>FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" 
and will be removed in 1.0.
</code></pre>

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

<pre><code>from flask_security import current_user, login_required, RoleMixin, Security, \
SQLAlchemyUserDatastore, UserMixin, utils
</code></pre>

<p>I don't seem to import Flask_WTF directly.</p>

<p>It looks like 1.7.5 is the latest release of Flask-Security.  And the latest version of Flask-WTF is 0.13 (make sure you have that installed by checking a <code>pip freeze</code>).</p>

<p>Since you don't use Flask-WTF directly, the issue isn't your code.  The issue is coming from Flask-Security's code itself, <a href="https://github.com/mattupstate/flask-security/blob/1.7.5/requirements.txt" rel="nofollow">which has Flask-WTF as a dependency</a>.</p>

<p>The way that Flask-Security imports the Form class from Flask-WTF is deprecated, so you're seeing the error when this line runs:</p>

<pre><code>from flask_wtf import Form as BaseForm
</code></pre>

<p><a href="https://github.com/mattupstate/flask-security/blob/e01cd63a214969cf8e4ee800d398e1c43b460c7f/flask_security/forms.py#L15" rel="nofollow">https://github.com/mattupstate/flask-security/blob/e01cd63a214969cf8e4ee800d398e1c43b460c7f/flask_security/forms.py#L15</a></p>

<p>You can either open an issue on Flask-Security (feel free to link to this question) or submit a pull request yourself to the author updating this line to the non-deprecated import</p>

<pre><code>from flask_wtf import FlaskForm as BaseForm
</code></pre>

<p>Make sure to run tests before / after too before submitting.</p>

<p>For a little more context, you can use git blame to see the commit that last changed the deprecated import line in Flask-Security (<a href="https://github.com/mattupstate/flask-security/commit/6f68f1d540502a1747cae87f0ffa2332cb4e2c94" rel="nofollow">6f68f1d</a>) on August 15, 2013.</p>

<p>Doing the same on Flask-WTF, you can see that the deprecation was introduced in <a href="https://github.com/lepture/flask-wtf/commit/42cc47562abf817c751ff22debbd9032a3c3f45d" rel="nofollow">42cc475</a> on June 30, 2016.</p>

python flask-security