dman
dman

Reputation: 11064

Django Temp. Table - Which is Correct Tool- Django-Redis or Redis-Py?

I have a webapp using DJango 1.6. This is a simple webapp that makes api calls from a forum and keeps track of threads that are unanswered. I want to store these unanswered thread collections in a redis temporary hash table.

What I am confused about is if I should be using django-redis(which also uses redis-py) or just redis-py. I have read django-redis documentation, and from what I can tell it is for the purpose of using redis to store Django sessions and other backend Django caches. For what I want to do which is just keep a temp. table of forum threads populated by a api call, would the proper tool be Django-Redis or Redis-py?

Upvotes: 2

Views: 569

Answers (2)

alecxe
alecxe

Reputation: 473873

django-redis just provides you with a redis cache backend:

django-redis is a BSD Licensed, full featured redis cache/session backend for Django.

With a redis-py you can "talk" to a redis server, it's a python redis interface.

As far as I understand, question is how you want to interact with redis - directly via the interface or using django's cache system. If you want this data to "expire" or you want to use redis for caching other entities, or you want to store sessions in redis - use django-redis. Also, there is nothing wrong to use redis-py directly or to use both.

Also see:

Upvotes: 5

Andrey Antukh
Andrey Antukh

Reputation: 195

Also, django-redis allows access to raw redis client: http://niwibe.github.io/django-redis/#_raw_client_access

This allows reuse same connection parameters and same connection pool for both purposes ;)

Upvotes: 1

Related Questions