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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
kporangehat's avatar
1
kporangehat
asked 11 years ago
Evgeny's avatar
13.2k
Evgeny
updated 11 years ago

Comments

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Fitoria's avatar
1.1k
Fitoria
answered 11 years ago
Evgeny's avatar
13.2k
Evgeny
updated 11 years ago
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 (11 years ago)

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 (11 years ago)

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 (11 years ago)
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 (11 years ago)

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

Evgeny's avatar Evgeny (11 years ago)
see more comments