Docs on multiple servers/memcached daemons not clear

2018-08-07 Thread ciaran . courtney
https://docs.djangoproject.com/en/2.1/topics/cache/#memcached

When running a memcached daemon on each server, is it implicitly implied 
that each memcached daemon should be configured to listen on 0.0.0.0 
(default is 127.0.0.1) so that all Django processes can get/set in one big 
memory pool, where one daemon is local (memory overhead) and rest are on 
network (hostname/network resulution overhead)

Or is there a possibility that you may want each server to have it's own 
isolated daemon?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e1bd5a77-cfb8-4ba6-b0e0-48d8c7a48136%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Docs on distributed memcached setup are not clear

2018-08-07 Thread ciaran . courtney
https://docs.djangoproject.com/en/2.1/topics/cache/#memcached

Particularly the multiple servers section, which does not detail if all 
memcached daemons should be configured to listen on all interfaces i.e. 
0.0.0.0

So just as a sanity check:

Scenario 1: (memcached installed naively ( i.e. listening on 
localhost:11211) on multiple ubuntu servers)
* Dev sets up her CACHE_LOCATIONS = ['server1:11211', 'server2:11211'] but 
is none the wiser that there is no interoperability between servers, 
meaning roughly 50% cache misses in totality.
* Each django process cycles through each location, only localhost is 
successful, no warning logs generated


Scenario 1: (memcached installed and configured to listen on 0.0.0.0:11211) 
on multiple ubuntu servers)
* Dev sets up her CACHE_LOCATIONS = ['server1:11211', 'server2:11211']  and 
django add/sets keys on all memcache servers successfully
* Each django process cycles through each location, adding/setting keys as 
it goes

So, am I right in thinking that the docs assume Scenario 2, but Scenario 1 
is a plausible setup, it would just mean lots of misses, but then a pro of 
no network overhead.

Am I missing something?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2f487741-4de5-41ed-8c66-7dd565c83948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Docs on multiple servers/memcached daemons not clear

2018-08-07 Thread ciaran . courtney
Sorry for double post, didn't realize there was an approval 
step https://groups.google.com/forum/#!topic/django-users/EZho7Y8KSOw

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ec5bc1d2-c79b-4823-87a6-ef0e645bc715%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to filter choices in Django2's autocomplete_fields?

2018-08-29 Thread ciaran . courtney
You need to override  ModelAdmin.get_search_results()  as per 
https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields

My problem is I override ForeignKeyField in AdminForm, where I can filter 
based on self.instance, this is not possible in current implementation 
AFAICS? The instance ID would have to be passed to the autocomplete_view

On Monday, 8 January 2018 16:49:56 UTC, Oren wrote:
>
> In Django 2.0, autocomplete_fields 
> 
>  was 
> added, which is great.
>
> Without autocomplete_fields, I can change the queryset of a 
> ForeignKeyField using formfield_for_foreignkey 
> 
> .
>
> But combining the two together doesn't work - it looks like the list of 
> options for autocomplete is dynamic and coming from a different url, 
> instead of from the current form.
>
> So the question is -
>
> How can I change the queryset in the autocomplete widget?
> Thanks,
> Oren
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f1b313c-82d6-454d-ba4e-85d7bbaa01c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to filter choices in Django2's autocomplete_fields?

2018-08-29 Thread ciaran . courtney
Not possible ATM it seems, pity https://code.djangoproject.com/ticket/29010

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b7492c86-2a3e-4d29-9add-b90f5284b718%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.