Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b7920e

Browse files
committed
Updated with Future Plans, plus app factory
1 parent 5ea6926 commit 5b7920e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ Flask-Redis
33

44
Adds Redis Support to Flask. Dead Simple.
55

6+
Currently a single namespace within the configuration is supported.
7+
8+
```
9+
REDIS_URL="redis://localhost"
10+
```
11+
12+
with the Redis instance automatically loading variables from this namespace.
13+
14+
In the future, the ability to declare multiple Redis namespaces will be available
15+
16+
```
17+
REDIS_CACHE_URL="redis://localhost/0"
18+
REDIS_METRICS_URL="redis://localhost/0"
19+
20+
redis_cache = Redis(config_prefix="REDIS_CACHE")
21+
redis_metrics = Redis(config_prefix="REDIS_METRICS")
22+
```
23+
624
## Installation
725

826
```
@@ -32,7 +50,10 @@ or
3250
from flask import Flask
3351
from flask_redis import Redis
3452
35-
app = Flask(__name__)
3653
redis = Redis()
37-
redis.init_app(app)
54+
55+
def create_app():
56+
app = Flask(__name__)
57+
redis.init_app(app)
58+
return app
3859
```

0 commit comments

Comments
 (0)