Skip to content

Commit

Permalink
Update the way to import the flask extension
Browse files Browse the repository at this point in the history
  • Loading branch information
lord63 committed Jan 23, 2016
1 parent d665ae9 commit c27cfea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ This is an example application that handles database migrations through Flask-Mi

```python
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
Expand Down
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Example
This is an example application that handles database migrations through Flask-Migrate::

from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
Expand Down Expand Up @@ -95,7 +95,7 @@ Command Reference

Flask-Migrate exposes two objects, ``Migrate`` and ``MigrateCommand``. The former is used to initialize the extension, while the latter is a ``Manager`` instance that needs to be registered with Flask-Script to expose the extension's command line options::

from flask.ext.migrate import Migrate, MigrateCommand
from flask_migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager.add_command('db', MigrateCommand)

Expand Down Expand Up @@ -156,7 +156,7 @@ Notes:
API Reference
-------------

The commands exposed by Flask-Migrate's interface to Flask-Script can also be accessed programmatically by importing the functions from module ``flask.ext.migrate``. The available functions are:
The commands exposed by Flask-Migrate's interface to Flask-Script can also be accessed programmatically by importing the functions from module ``flask_migrate``. The available functions are:

- ``init(directory='migrations', multidb=False)``
Initializes migration support for the application.
Expand Down
2 changes: 1 addition & 1 deletion flask_migrate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import argparse
from flask import current_app
from flask.ext.script import Manager
from flask_script import Manager
from alembic import __version__ as __alembic_version__
from alembic.config import Config as AlembicConfig
from alembic import command
Expand Down

0 comments on commit c27cfea

Please sign in to comment.