WebFaction
Community site: login faq
0
2

In Django 1.3, they changed the way you set up cache in settings.py.
Before (and in Webfaction's docs), I used the socket variant:

CACHE_BACKEND = 'memcached://unix:/home/mistalaba/memcached.sock'

Now the Django doc recommends doing it like this:

CACHES = {  
    'default': {  
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',  
        'LOCATION': '127.0.0.1:11211',  
    }  
}

Any good suggestions on converting the old way to not be depreciated in the future?

Thank you!

Edit: After a few brave attempts from @cmdkeen and myself, it seems like the only option is to set up a new app in the panel and use the directions in http://community.webfaction.com/questions/784/django-memcached-stats instead of trying to get webfaction's set up to work.

asked 06 Apr '11, 07:17

marty3d's gravatar image

marty3d
113
accept rate: 0%

edited 12 Apr '11, 01:08


Try this:

CACHES = {  
    'default': {  
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',  
        'LOCATION': 'unix:/home/mistalaba/memcached.sock',  
    }  
}

Hope that helps!

permanent link

answered 06 Apr '11, 08:54

seanf's gravatar image

seanf ♦♦
11.8k21333
accept rate: 37%

I am sorry, but that didn't work. The result was InvalidCacheBackendError: Backend URI must start with scheme://

(06 Apr '11, 11:16) marty3d marty3d's gravatar image

It seems to work for me with the following location:

unix://unix:/path/to/memcached.sock

So all you were missing was the scheme:// definition, was a pure guess on my part that unix was the scheme rather than memcached :)

Edit to add - on further investigation it isn't actually working for me, just not throwing an exception... I was however trying with redis rather than memcached (some stackoverflow answer said they were API compatible)

permanent link

answered 10 Apr '11, 17:14

cmdkeen's gravatar image

cmdkeen
112
accept rate: 0%

edited 10 Apr '11, 17:42

Thanks for trying! I didn't have enough points to "like" your post, so I'll mention it here instead.

(12 Apr '11, 01:09) marty3d marty3d's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×888
×111
×34

question asked: 06 Apr '11, 07:17

question was seen: 3,948 times

last updated: 12 Apr '11, 01:09

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM