Comments (20)
django-redis in the past was fork of django-redis-cache but currently the codebase differs a lot.
redis_cache module name was for module compatibility with django-redis-cache. But you are right, it is still confusing. It would be good idea to change module name and put deprecation waring for the old?
from django-redis.
yep, that sounds good.
I just had a nightmare debugging an installation where both packages (django-redis and django-redis-cache) where installed. pip uninstalling django-redis-cache still left redis_cache
as importable package (the wrong one). It was pretty confusing to find out what was going on.
from django-redis.
Thanks! I like the idea, djredis or django_redis are good module name for you? Any suggestions?
from django-redis.
Are you going planning to add functionality other than cache related stuff?
Because django-redis
is a pretty general name if the package only handles caching.
from django-redis.
django redis works well as cache, session and raw access to redis connection pool. Seems, cache is not a single purpose for django-redis
from django-redis.
ok. So I guess django-redis
is a fitting name then.
I personally prefer django_redis
because it matches the package name.
from django-redis.
Thanks!
from django-redis.
π for django_redis
.
from django-redis.
π agreed, the namespace should match the PyPI package name. Any plans for this @niwibe?
from django-redis.
Yes, I have plans for it, but I don't know the best way to do a transition, mataining some versions (two) a backward compatibility.
from django-redis.
One library to use in the transition is Six.
https://pythonhosted.org/six/
from django-redis.
Yes, is for python2->python3 transition, but django-redis is already works with python2/3 very well.
This issue talks about package name change of django-redis from "redis_cache" to "django_redis" and is slighty complicated mantaining all backward compatibility on the public module interface ;)
from django-redis.
One solution is to have two packages, a redis_cache
and a django_redis
such that, during deprecation, from redis_cache import ...
and from django_redis import ...
do the same. (i.e. __init__.py
in redis_cache
does from django_redis import *
and sub-packages.
When installed from pip, both packages are installed.
This allows the deprecation timeline for the redis_cache
, potentially with some deprecation warnings in the middle if redis_cache
is imported.
from django-redis.
@jorgecarleitao Yes, thatβs the best solution. I suggest we write something in setup.py thatβll just make a cp django_redis redis_cache
and automatically append to every file:
import warnings
warnings.warn('redis_cache was renamed to django_redis', DeprecationWarning)
from django-redis.
When you are it, the usage of underscore is discouraged in Python PyPi package names (though ok in module names for readability):
http://legacy.python.org/dev/peps/pep-0008/#package-and-module-names
Though the usefulness of this convention is highly debatable and not many packages follow it.
from django-redis.
@miohtama But redis-py β a dependency of django-redis β already uses redis
as a package name.
from django-redis.
@niwibe Is the purpose of this package django in general or only caches in django?
from django-redis.
@YAmikep the purpose is mainly for cache, sessions and general usage of raw redis connection in django. Django session does not requires new backend implementation because it can use the cache backend for it. In some cases django apps requires a raw redis client access, django redis has facilities for reuse the same connection pool of cache for different purposes.
Thanks to all different ideas. I'll try fix it in one week, I'm currently with very limmited connectivity.
from django-redis.
@niwibe Ok thanks. If the purpose is for general usage of redis with django, something like django_redis
Vs. redis_cache
would be more appropriated then.
from django-redis.
Now commited in master ;) thanks to all!
from django-redis.
Related Issues (20)
- Connection Pooling doesn't work as intended HOT 1
- Pytest 7.0 compatibility HOT 1
- Drop django 4.0
- Drop support for django 3.2 HOT 1
- How to configure and connect redis cluster correctly? HOT 2
- Django `TIMEOUT` setting not working as expected HOT 2
- Which timezone wil it take? system timezone or django timezone HOT 1
- Why Django Redis does not raise exception while connecting to Redis Server with SSL param equal string "False"
- `Expire` method fails when using `DEFAULT_TIMEOUT` HOT 1
- Getting/Setting occasionally extremely slow HOT 5
- django requirements update
- Add NX, XX, GT and LT to expire and pexpire HOT 2
- Multiple redis caches with fallback mechanism HOT 1
- Is it necessary to get coverage of tests directory? HOT 2
- Implementing HGET
- using redis in django getting connection error HOT 1
- strict_map_key
- Connection refused on Celery health checks HOT 3
- how to support hash ops, such as hset, hget...
- Reauthentication with Azure AD / Entra ID
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-redis.