Giter Site home page Giter Site logo

Comments (7)

alasdairnicol avatar alasdairnicol commented on July 24, 2024 3

Sorry to comment on a closed issue. After reading @cjproud's comment, my understanding is that redis and therefore django-redis will automatically use the hiredis parser if hiredis is installed.

Therefore I think it would be better if the django-redis docs removed the suggestion to set PARSER_CLASS. We could keep a note about removing before upgrading to redis-py >= 5 to avoid errors.

I'd be happy to draft a PR if there's agreement.

from django-redis.

cjproud avatar cjproud commented on July 24, 2024 1

I've noticed this issue as well. @jacklinke's proposed fix of changing redis.connection.HiredisParser to redis.connection._HiredisParser within the cache portion of the Django settings fixed the issue for me 👍

from django-redis.

jacklinke avatar jacklinke commented on July 24, 2024 1

@cjproud yep, it's reflected in the docs from #677

Now that it's resolved I'll close out this issue.

from django-redis.

jacklinke avatar jacklinke commented on July 24, 2024

Please see my issue at redist-py with a note on how to resolve this issue when using djano-redis with redis-py 5.0.0.

The docs here should probably be updated to reflect the change as well.

redis/redis-py#2895

from django-redis.

WisdomPill avatar WisdomPill commented on July 24, 2024

would be nice to make it automatic based on the version of redis-py... is anyone open to make a PR for it? otherwise I can step in

from django-redis.

cjproud avatar cjproud commented on July 24, 2024

@WisdomPill I can see at L8 of django_redis/pool.py the following line which imports a constant, DefaultParser, from redis-py:

from redis.connection import DefaultParser, to_bool

DefaultParser is defined in redis-py/redis/connection.py as:

if HIREDIS_AVAILABLE:
    DefaultParser = _HiredisParser
else:
    DefaultParser = _RESP2Parser

so I'm not sure anything has to be done other than the Django projects that explicitly call the HiredisParser should be changed to _HiredisParser (or DefaultParser) - which is reflected in the docs change? I could be missing something here!

from django-redis.

alexgmin avatar alexgmin commented on July 24, 2024

I can confirm that redis-py uses hiredis automatically as the parser if it's available, so there's no need for the docs to suggest using it explicitly in the settings.

from django-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.