epicserve / django-cache-url

Use Cache URLs in your Django Application
MIT License
18 stars 12 forks source link

unix scheme breaks on redis-py 4.4.0 because of single slash #23

Closed kalekseev closed 1 year ago

kalekseev commented 1 year ago

Starting from v4.4.0 redis-py throws a error that "unix:" scheme must start with double slashes "unix://" https://github.com/redis/redis-py/pull/2343/files#diff-45b6ba995a827b484d3ef97cb806d336bf058ff9678b04cf371200ea53e584d0R1172

While this library generate scheme with a single slash:

In [1]: from django_cache_url import parse

In [2]: import os

In [3]: parse(os.environ['CACHE_URL'])
Out[3]:
{'BACKEND': 'django.core.cache.backends.redis.RedisCache',
 'LOCATION': 'unix:/redis/redis.sock?db=0'}

In [4]: os.environ['CACHE_URL']
Out[4]: 'redis:///redis/redis.sock/0'

Ref https://github.com/redis/redis-py/issues/2489