{{{
CACHES = {
'default': {
'LOCATION': 'server1.foo.com;server2.foo.com',
},
}
}}}
This is because the backend
[https://github.com/django/django/blob/1.10/django/core/cache/backends/memcached.py#L16
just does]:
{{{
self._servers = server.split(';')
}}}
However cloud memcached offerings such as Memcachier and Memcached Cloud
typically use a comma-delimited list in the automatically set environment
variable, eg:
{{{
MEMCACHIER_SERVERS='foo.us-east-5.heroku.prod.memcachier.com:11211,bar.us-
east-5.heroku.prod.memcachier.com:11211'
}}}
Given that the caches `LOCATION` parameter contains only domain name and
port (and not say passwords), it should never contain a comma - so we
should be fine to also split on them too.
--
Ticket URL: <https://code.djangoproject.com/ticket/27152>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* type: Bug => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
I guess `server.replace(',', ';').split(';')` should work.
--
Ticket URL: <https://code.djangoproject.com/ticket/27152#comment:1>
* status: new => assigned
* owner: nobody => alexyer
--
Ticket URL: <https://code.djangoproject.com/ticket/27152#comment:2>
* owner: alexyer => edmorley
Comment:
Ah I have this finished locally already - sorry thought I'd set the ticket
assignee already!
--
Ticket URL: <https://code.djangoproject.com/ticket/27152#comment:3>
Comment (by alexyer):
Ok. Not a problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/27152#comment:4>
* cc: emorley@… (added)
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/27152#comment:5>
* stage: Accepted => Ready for checkin
Comment:
Pending a few cosmetic edits.
--
Ticket URL: <https://code.djangoproject.com/ticket/27152#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"d8ef5b0e6501692b8b767ebccddc936f496d77e8" d8ef5b0e]:
{{{
#!CommitTicketReference repository=""
revision="d8ef5b0e6501692b8b767ebccddc936f496d77e8"
Fixed #27152 -- Supported comma delimiter in memcached LOCATION string.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27152#comment:7>