WebFaction
Community site: login faq

I'm trying to setup memcache with my django app (django version 1.2).

I've configured based on the webfaction docs (http://docs.webfaction.com/software/memcached.html#memcached-setting-up) and added the following line to my settings.py:

CACHE_BACKEND = 'memcached://unix:/home/<my user id>/memcached.sock' (where, of course, <my user id> is replace by my actual user id ...)

But when I restart my apache instance, I've got the following error:

mod_wsgi (pid=19782): Exception occurred processing WSGI script '/home/<my user id>/webapps/netday/netday.wsgi'.
Traceback (most recent call last):
  File "/home/<my user id>/webapps/<my user id>/lib/python2.5/django/core/handlers/wsgi.py", line 241, in __call__
  File "/home/<my user id>/lib/python2.5/django/core/handlers/base.py", line 76, in get_response
   response = middleware_method(request)
  File "/home/<my user id>/lib/python2.5/django/middleware/common.py", line 56, in process_request
     if (not _is_valid_path(request.path_info) and
  File "/home/<my user id>/lib/python2.5/django/middleware/common.py", line 142, in _is_valid_path
   urlresolvers.resolve(path)
  File "/home/<my user id>/lib/python2.5/django/core/urlresolvers.py", line 309, in resolve
   return get_resolver(urlconf).resolve(path)
  File "/home/<my user id>/lib/python2.5/django/core/urlresolvers.py", line 220, in resolve
   for pattern in self.url_patterns:
  File "/home/<my user id>/lib/python2.5/django/core/urlresolvers.py", line 249, in _get_url_patterns
   patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/<my user id>/lib/python2.5/django/core/urlresolvers.py", line 244, in _get_urlconf_
  ...skipping...
   self.servers = [_Host(s, self.debuglog) for s in servers]
  File "/usr/local/lib/python2.5/site-packages/python_memcached-1.40-py2.5.egg/memcache.py", line 769, in __init__
  self.port = int(self.port)
ValueError: invalid literal for int() with base 10: '/home/<my user id>/memcached.sock'

Apparently, for a reason I don't understand yet, the memcache backend tried to interpret the unix://path/to/file.sock as a host:port and fails miserably.

An idea where I should look at ?

Many thanks.

asked 16 May '11, 16:08

Fil
111
accept rate: 0%

(16 May '11, 16:18) Fil

permanent link

answered 16 May '11, 16:26

Fil
111
accept rate: 0%

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:

×900
×34

question asked: 16 May '11, 16:08

question was seen: 2,659 times

last updated: 16 May '11, 16:26

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