Code Monkey home page Code Monkey logo

Comments (20)

niwinz avatar niwinz commented on June 17, 2024

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.

stefanfoulis avatar stefanfoulis commented on June 17, 2024

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.

niwinz avatar niwinz commented on June 17, 2024

Thanks! I like the idea, djredis or django_redis are good module name for you? Any suggestions?

from django-redis.

stefanfoulis avatar stefanfoulis commented on June 17, 2024

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.

niwinz avatar niwinz commented on June 17, 2024

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.

stefanfoulis avatar stefanfoulis commented on June 17, 2024

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.

niwinz avatar niwinz commented on June 17, 2024

Thanks!

from django-redis.

BertrandBordage avatar BertrandBordage commented on June 17, 2024

πŸ‘ for django_redis.

from django-redis.

dencold avatar dencold commented on June 17, 2024

πŸ‘ agreed, the namespace should match the PyPI package name. Any plans for this @niwibe?

from django-redis.

niwinz avatar niwinz commented on June 17, 2024

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.

duly avatar duly commented on June 17, 2024

One library to use in the transition is Six.
https://pythonhosted.org/six/

from django-redis.

niwinz avatar niwinz commented on June 17, 2024

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.

jorgecarleitao avatar jorgecarleitao commented on June 17, 2024

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.

BertrandBordage avatar BertrandBordage commented on June 17, 2024

@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.

miohtama avatar miohtama commented on June 17, 2024

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.

BertrandBordage avatar BertrandBordage commented on June 17, 2024

@miohtama But redis-py – a dependency of django-redis – already uses redis as a package name.

from django-redis.

YAmikep avatar YAmikep commented on June 17, 2024

@niwibe Is the purpose of this package django in general or only caches in django?

from django-redis.

niwinz avatar niwinz commented on June 17, 2024

@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.

YAmikep avatar YAmikep commented on June 17, 2024

@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.

niwinz avatar niwinz commented on June 17, 2024

Now commited in master ;) thanks to all!

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.