Ask Your Question
1

How to configure askbot with redis

asked 2013-05-20 14:33:23 -0600

kporangehat gravatar image

updated 2013-05-20 18:41:26 -0600

Evgeny gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-05-20 14:35:45 -0600

updated 2013-05-20 21:40:40 -0600

Evgeny gravatar image

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
edit flag offensive delete link more

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 gravatar imagekporangehat ( 2013-05-20 18:35:42 -0600 )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 gravatar imageEvgeny ( 2013-05-20 18:40:54 -0600 )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 gravatar imagekporangehat ( 2013-05-20 19:04:41 -0600 )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 gravatar imageFitoria ( 2013-05-20 19:06:44 -0600 )edit

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

Evgeny gravatar imageEvgeny ( 2013-05-20 19:11:52 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-20 14:33:23 -0600

Seen: 4,203 times

Last updated: May 20 '13