Merge pull request #7 from rubikscuber/patch-1
respect custom redis uri
This commit is contained in:
@@ -24,6 +24,7 @@ from quart_session import Session
|
||||
|
||||
app = Quart(__name__)
|
||||
app.config['SESSION_TYPE'] = 'redis'
|
||||
app.config['SESSION_URI'] = 'redis://:password@localhost:6379'
|
||||
Session(app)
|
||||
|
||||
@app.route('/')
|
||||
|
||||
@@ -228,8 +228,9 @@ class RedisSessionInterface(SessionInterface):
|
||||
"""
|
||||
if self.backend is None:
|
||||
import aioredis
|
||||
uri = app.config.get('SESSION_URI', 'redis://localhost')
|
||||
self.backend = await aioredis.from_url(
|
||||
"redis://localhost", encoding="utf-8", decode_responses=True
|
||||
uri, encoding="utf-8", decode_responses=True
|
||||
)
|
||||
|
||||
async def get(self, key: str, app: Quart = None):
|
||||
|
||||
Reference in New Issue
Block a user