First time here? Check out the FAQ!
1

How to configure askbot with redis

I've got the github askbot-devel repo installed and running on Postgres 9.2. Now it appears that none of the settings I save on the settings page actually get saved. It's not intermittent, they never appear and there are no errors on the page or in the logs. I saw multiple references to this possibly being related to not having a cacheing system setup.

If I want to use redis, how do I configure askbot to work with it? I only see examples for memcached. Is memcached preferred?

thx

kporangehat's avatar
1
kporangehat
asked 2013-05-20 14:33:23 -0500
Evgeny's avatar
13.2k
Evgeny
updated 2013-05-20 18:41:26 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Use django-redis-cache just follow the project docs on the github README and it will work.

edit: these cache-related settings work on django 1.4.5.

CACHE_BACKEND = 'redis_cache.cache://localhost:6379'
CACHE_TIMEOUT = 6000
LIVESETTINGS_CACHE_TIMEOUT = CACHE_TIMEOUT
CACHE_PREFIX = 'askbot2' #make this unique
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
Fitoria's avatar
1.1k
Fitoria
answered 2013-05-20 14:35:45 -0500
Evgeny's avatar
13.2k
Evgeny
updated 2013-05-20 21:40:40 -0500
edit flag offensive 0 remove flag delete link

Comments

This worked well for installing redis and getting it configured thank you.

However... it didn't solve the issue of my settings not being saved. None of my settings get saved from the settings page. No error is generated on the page, nor in the logs so I'm not sure where to go from here.

kporangehat's avatar kporangehat (2013-05-20 18:35:42 -0500) edit

That sounds odd. You might have duplicate configuration statements for cache and effectively you are still using locmem caching or redis server is not running, not configured correctly.

Evgeny's avatar Evgeny (2013-05-20 18:40:54 -0500) edit

I ran a cache test using the django shell as described in http://askbot.org/en/question/8273/how-do-i-check-if-memcache-is-working/. I have tested the redis client/server directly and they are working without error as well.

In my settings.py file I commented out all of the CACHE_* settings and only have:

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': '127.0.0.1:6379',
        'OPTIONS': {
           'DB': 1,
            #'PASSWORD': 'yadayada',
            'PARSER_CLASS': 'redis.connection.HiredisParser'
        },
    },
}

(can't do code formatting in the comment I guess... sorry)

kporangehat's avatar kporangehat (2013-05-20 19:04:41 -0500) edit
1

Use this setting instead: CACHE_BACKEND = 'redis_cache.cache://<host>:<port>' the livesettings app has a dependency that use that setting in some part.

Fitoria's avatar Fitoria (2013-05-20 19:06:44 -0500) edit

I will look into fixing this config issue in the livesettings, did not know about this.

Evgeny's avatar Evgeny (2013-05-20 19:11:52 -0500) edit
add a comment see more comments