cunla / fakeredis-py

Implementation of Redis in python without having a Redis server running. Fully compatible with using redis-py.
https://fakeredis.moransoftware.ca/
BSD 3-Clause "New" or "Revised" License
298 stars 48 forks source link

Update django cache integration documentation #284

Closed ulmus closed 9 months ago

ulmus commented 9 months ago

Update the documentation to reflect that django test settings need to be set in the CONNECTION_POOL_KWARGS key

ulmus commented 9 months ago

I believe that the failing test is not based on any changes in this PR, since it only touches documentation.

ldkv commented 9 months ago

Hello, FYI I cannot run the test with the new settings with CONNECTION_POOL_KWARGS.

The old setting works for me. Can you verify this please?

cunla commented 9 months ago

What version of django are you using?

@ulmus, do you mind confirming?

ldkv commented 9 months ago

I'm using Django 4.2.7.

Here is the error I got:

TypeError: AbstractConnection.__init__() got an unexpected keyword argument 'CONNECTION_POOL_KWARGS'

cunla commented 9 months ago

I'll revert the changes for now. Thanks for bringing this up!

ldkv commented 9 months ago

I verified and CONNECTION_POOL_KWARGS is an option for 3rd party package django-redis.

However, the example given in the docs is for official implementation of Django Redis.

This explains the confusion.

cunla commented 9 months ago

ok, that makes sense. Do you mind adding a section in the documentation explaining that? (django out-of-the-box redis cache vs. django-redis cache)

ldkv commented 9 months ago

Done !

ulmus commented 9 months ago

Good catch! That was why it didn't work for me. Good to have both options described!