Skip to content

Commit f840e5c

Browse files
committed
update documentation
1 parent b8db40e commit f840e5c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,21 @@ INSTALLATION
1515
------------
1616

1717
1. Install flask replicated distribution using ``pip install flask_replicated``.
18+
Or add ``flask-replicated==1.4`` in requirements.txt and requirements
19+
``pip3 install -r requirements.txt``.
1820

19-
2. In flask ``app.config`` configure your database bindings a standard way::
21+
2. Import library ``from flask_replicated import FlaskReplicated`` or
22+
``import flask_replicated`` depending on how you want to call the functions or decorators
23+
24+
3. In flask ``app.config`` configure your database bindings a standard way::
2025

2126
SQLALCHEMY_DATABASE_URI = '%(schema)s://%(user)s:%(password)s@%(master_host)s/%(database)s'
2227
SQLALCHEMY_BINDS = {
2328
'master': SQLALCHEMY_DATABASE_URI,
2429
'slave': '%(schema)s://%(user)s:%(password)s@%(slave_host)s/%(database)s'
2530
}
2631

27-
3. Register app extension::
32+
4. Register app extension::
2833

2934
app = Flask(...)
3035
...
@@ -48,7 +53,7 @@ To handle these situations wrap appropriate view function with
4853
``@flask_replicated.changes_database`` decorator. It will mark function to
4954
always use master database url.
5055

51-
Conversely, wrap the view function with the ``@use_slave_database``
56+
Conversely, wrap the view function with the ``@flask_replicated.use_slave_database``
5257
decorator if you want to ensure that it always uses the slave replica.
5358

5459
GET after POST

0 commit comments

Comments
 (0)