Updated requirements
- Added websockets to production.txt - Import channels_redis in redis.py only for big mode (if use_redis=true)
This commit is contained in:
parent
1da7ba51fd
commit
e16ca335de
@ -1,7 +1,6 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from channels_redis.core import ConnectionPool
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from . import logging
|
from . import logging
|
||||||
@ -14,14 +13,16 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
use_redis = False
|
use_redis = False
|
||||||
else:
|
else:
|
||||||
|
from channels_redis.core import ConnectionPool
|
||||||
|
|
||||||
# set use_redis to true, if there is a value for REDIS_ADDRESS in the settings
|
# set use_redis to true, if there is a value for REDIS_ADDRESS in the settings
|
||||||
redis_address = getattr(settings, "REDIS_ADDRESS", "")
|
redis_address = getattr(settings, "REDIS_ADDRESS", "")
|
||||||
use_redis = bool(redis_address)
|
use_redis = bool(redis_address)
|
||||||
if use_redis:
|
if use_redis:
|
||||||
logger.info(f"Redis address {redis_address}")
|
logger.info(f"Redis address {redis_address}")
|
||||||
|
|
||||||
pool = ConnectionPool({"address": redis_address})
|
pool = ConnectionPool({"address": redis_address})
|
||||||
counter = 0
|
counter = 0
|
||||||
|
|
||||||
|
|
||||||
class RedisConnectionContextManager:
|
class RedisConnectionContextManager:
|
||||||
|
@ -6,4 +6,4 @@ aioredis>=1.1.0,<1.3
|
|||||||
|
|
||||||
# Requirements for fast asgi server
|
# Requirements for fast asgi server
|
||||||
gunicorn>=19.9.0,<20
|
gunicorn>=19.9.0,<20
|
||||||
uvicorn>=0.3.2,<1.1
|
uvicorn>=0.9,<1.0
|
||||||
|
@ -15,3 +15,4 @@ PyPDF2>=1.26,<1.27
|
|||||||
roman>=2.0,<3.2
|
roman>=2.0,<3.2
|
||||||
setuptools>=29.0,<42.0
|
setuptools>=29.0,<42.0
|
||||||
typing_extensions>=3.6.6,<3.8
|
typing_extensions>=3.6.6,<3.8
|
||||||
|
websockets>=8.0,<9.0
|
Loading…
Reference in New Issue
Block a user