Skip to content

Commit

Permalink
Merge pull request #235 from jeffwidman/fix-deprecated-extension-naming
Browse files Browse the repository at this point in the history
Swap from deprecated flask.ext.* to flask_*
  • Loading branch information
lepture committed Apr 26, 2016
2 parents 4541556 + 23e29b7 commit b5f7bb1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/csrf.rst
Expand Up @@ -77,7 +77,7 @@ needed, you can exclude some views using a decorator::
If needed, you can also exclude all the views from within a given Blueprint:

csrf.exempt(account_blueprint)

You can also disable CSRF protection in all views by default, by setting
``WTF_CSRF_CHECK_DEFAULT`` to ``False``, and selectively call
``csrf.protect()`` only when you need. This also enables you to do some
Expand Down Expand Up @@ -134,7 +134,7 @@ Troubleshooting
---------------

When you define your forms, if you make `the mistake`_ of importing
``Form`` from ``wtforms`` instead of from ``flask.ext.wtf``, most
``Form`` from ``wtforms`` instead of from ``flask_wtf``, most
features besides CSRF protection will work (aside from
``form.validate_on_submit()``), but CSRF protection will fail. Upon
submitting forms, you’ll get
Expand Down
4 changes: 2 additions & 2 deletions docs/form.rst
Expand Up @@ -35,7 +35,7 @@ File Uploads
Flask-WTF provides you a :class:`FileField` to handle file uploading,
it will automatically draw data from ``flask.request.files`` if the form
is posted. The ``data`` attribute of :class:`FileField` will be an
instance of Werkzeug FileStorage.
instance of Werkzeug FileStorage.

For example::

Expand Down Expand Up @@ -71,7 +71,7 @@ are :class:`FileRequired` and :class:`FileAllowed`.

The :class:`FileAllowed` works well with Flask-Uploads, for example::

from flask.ext.uploads import UploadSet, IMAGES
from flask_uploads import UploadSet, IMAGES
from flask_wtf import Form
from flask_wtf.file import FileField, FileAllowed, FileRequired

Expand Down
6 changes: 3 additions & 3 deletions examples/babel/app.py
@@ -1,9 +1,9 @@
from flask import Flask, render_template, request
from wtforms import TextField
from wtforms.validators import DataRequired
from flask.ext.wtf import Form
from flask.ext.babel import Babel
from flask.ext.babel import lazy_gettext as _
from flask_wtf import Form
from flask_babel import Babel
from flask_babel import lazy_gettext as _


class BabelForm(Form):
Expand Down
4 changes: 2 additions & 2 deletions examples/flaskr/flaskr.py
Expand Up @@ -14,10 +14,10 @@
from __future__ import with_statement
from flask import (Flask, session, redirect, url_for, abort,
render_template, flash)
from flask.ext.wtf import Form
from flask_wtf import Form
from wtforms import TextField, TextAreaField, PasswordField, SubmitField
from wtforms.validators import DataRequired, ValidationError
from flask.ext.sqlalchemy import SQLAlchemy
from flask_sqlalchemy import SQLAlchemy

# configuration
DEBUG = True
Expand Down
4 changes: 2 additions & 2 deletions examples/recaptcha/app.py
@@ -1,8 +1,8 @@
from flask import Flask, render_template, flash, session, redirect, url_for
from wtforms import TextAreaField
from wtforms.validators import DataRequired
from flask.ext.wtf import Form
from flask.ext.wtf.recaptcha import RecaptchaField
from flask_wtf import Form
from flask_wtf.recaptcha import RecaptchaField


DEBUG = True
Expand Down
2 changes: 1 addition & 1 deletion flask_wtf/file.py
Expand Up @@ -47,7 +47,7 @@ class FileAllowed(object):
Flask-Uploads UploadSet.
:param upload_set: A list/tuple of extention names or an instance
of ``flask.ext.uploads.UploadSet``
of ``flask_uploads.UploadSet``
:param message: error message
You can also use the synonym **file_allowed**.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_i18n.py
Expand Up @@ -15,7 +15,7 @@ def test_i18n_disabled(self):

def test_i18n_enabled(self):
from flask import request
from flask.ext.babel import Babel
from flask_babel import Babel
babel = Babel(self.app)

@babel.localeselector
Expand Down

0 comments on commit b5f7bb1

Please sign in to comment.