Re: Use CDN for djangoproject.com

2019-02-13 Thread Florian Apolloner


On Wednesday, February 13, 2019 at 11:25:37 PM UTC+1, Josh Smeaton wrote:
>
> Why do we not want to use Cloudflare?
>

Last time I checked (if one puts the full site behind cloudflare) you'd 
have nasty checks that usually triggers captchas for Tor users etc. From 
what I can tell there was no way to __fully__ turn it off (this might have 
changed though). Also cloudflare puts cookies on your PC etc, this is not 
something I need from a CDN.

Cheers,
Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d43a60ca-6281-4238-a023-4fe5c792b0c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use CDN for djangoproject.com

2019-02-13 Thread Markus Holtermann
Hi all

to elaborate on what Tobias said: we deliberately have the infrastructure 
spread across multiple service providers: DNS registry, nameservers, hosting, 
TLS certificate authority, … None of them have access to everything. The reason 
is that we offer the download of the release artifacts from the 
djangoproject.com website. And we would like to ensure that the TLS termination 
happens by us and not some random service provider. After all, Django is used 
by enterprises that do have some restrictions on where you're allowed to 
download software from.

By handing over DNS to some CDN provider, we loose the ability to ensure that 
happens.

That said, if there's a CDN that works as a reverse proxy and doesn't require 
us to hand over control of DNS, I guess we could be interested in moving the 
docs behind that.

/Markus

On Thu, Feb 14, 2019, at 2:22 AM, Tobias McNulty wrote:
> For me it's the trust factor (allowing someone else to decrypt and 
> re-encrypt all our data). This may be less of an issue for the docs 
> site, *if* we don't have to assign DNS authority for the whole domain 
> to the CDN provider.
> 
> Tobias
> 
> 
> On Wed, Feb 13, 2019, 7:47 PM Kye Russell  > I’ve been hearing that there are other CDN providers that offer a very 
> > comparable service for a fraction of the cost of CloudFront. 
> > 
> > Anyways, at this stage let’s not get bogged down on provider decisions. I’m 
> > curious if anyone has any general objections to a CDN of any kind. 
> > 
> > It shouldn’t be that big a deal to automatically invalidate when the docs 
> > are updated. But I’m sure there’s something I’m missing. 
> > 
> > On Thu, 14 Feb 2019 at 8:36 am, Cristiano Coelho  
> > wrote:
> >> Consider AWS's cloudfront then :)
> >> 
> >> El martes, 12 de febrero de 2019, 2:34:09 (UTC-5), Florian Apolloner 
> >> escribió:
> >>> Especially cloudflare is a service we do not want to use. as for the docs 
> >>> only, does the mirror on rtd work better for you? They are probably 
> >>> behind a CDN.
> >>> 
> >>> Cheers,
> >>> Florian
> >>> 
> >>> On Tuesday, February 12, 2019 at 6:43:41 AM UTC+1, Cheng C wrote:
>  Hi,
>  
>  Is it possible to utilize a CDN service for djangoproject.com, or at 
>  least on docs.djangoproject.com? The site is actually quite fast for me 
>  but I think there is still room for improvement. Cloudflare sponsored 
>  dozens of open source projects 
>  , probably they can 
>  provide free service for django as well.
>  
>  Tested from Melbourne, Australia:
>  
>  https://www.djangoproject.com/
>   Average Ping: 245ms
>   Browser: 21 requests, 211KB transferred, Finish: 2.52s, 
>  DOMContentLoaded: 1.16s, Load: 1.48s
>  
>  https://git-scm.com/
>   Average Ping: 5ms
>   Browser: 42 requests, 351KB transferred, Finish: 717ms, 
>  DOMContentLoaded: 564ms, Load: 699ms
>  
>  Tested on Chrome with "Disable cache" checked (but not the first time 
>  visit, so DNS query time might not be included).
>  
>  Best regards and thanks for all your great work. 
> >>  
> 
> 
> >>  -- 
> >>  You received this message because you are subscribed to the Google Groups 
> >> "Django developers (Contributions to Django itself)" group.
> >>  To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to django-developers+unsubscr...@googlegroups.com.
> >>  To post to this group, send email to django-developers@googlegroups.com.
> >>  Visit this group at https://groups.google.com/group/django-developers.
> >>  To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/django-developers/548db807-647f-4d0b-99c2-f9f229f7175e%40googlegroups.com
> >>  
> >> .
> >>  For more options, visit https://groups.google.com/d/optout.
> >>  
> >  
> 
> 
> >  -- 
> >  You received this message because you are subscribed to the Google Groups 
> > "Django developers (Contributions to Django itself)" group.
> >  To unsubscribe from this group and stop receiving emails from it, send an 
> > email to django-developers+unsubscr...@googlegroups.com.
> >  To post to this group, send email to django-developers@googlegroups.com.
> >  Visit this group at https://groups.google.com/group/django-developers.
> >  To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/django-developers/CANK-yknQ1Auf6CFD-%2B94qoATQ2K%2By0poLw%3DaxyJYjO3PaHOQWA%40mail.gmail.com
> >  
> > .
> >  For more options, visit https://groups.google.com/d/optout.
> >  
>  
> 
> 
>  -- 
>  You received this message because you are subscribed to the Google 
> Groups 

Re: CharField with Oracle Backend Null Behaviour

2019-02-13 Thread Dan Davis
This very issue of a not-null constraint causes a problem with 
django-silk.  I'm not sure this matters in practice, because the usage of 
django silk is usually for development; I just added an sqlite3 database 
alias and a router for django-silk.   However, it validates the problem of 
the current approach.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/3fd3a890-6669-46d0-b79a-bf0dc86f2538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use CDN for djangoproject.com

2019-02-13 Thread Tobias McNulty
For me it's the trust factor (allowing someone else to decrypt and
re-encrypt all our data). This may be less of an issue for the docs site,
*if* we don't have to assign DNS authority for the whole domain to the CDN
provider.

Tobias


On Wed, Feb 13, 2019, 7:47 PM Kye Russell  I’ve been hearing that there are other CDN providers that offer a very
> comparable service for a fraction of the cost of CloudFront.
>
> Anyways, at this stage let’s not get bogged down on provider decisions.
> I’m curious if anyone has any general objections to a CDN of any kind.
>
> It shouldn’t be that big a deal to automatically invalidate when the docs
> are updated. But I’m sure there’s something I’m missing.
>
> On Thu, 14 Feb 2019 at 8:36 am, Cristiano Coelho 
> wrote:
>
>> Consider AWS's cloudfront then :)
>>
>> El martes, 12 de febrero de 2019, 2:34:09 (UTC-5), Florian Apolloner
>> escribió:
>>>
>>> Especially cloudflare is a service we do not want to use. as for the
>>> docs only, does the mirror on rtd work better for you? They are probably
>>> behind a CDN.
>>>
>>> Cheers,
>>> Florian
>>>
>>> On Tuesday, February 12, 2019 at 6:43:41 AM UTC+1, Cheng C wrote:

 Hi,

 Is it possible to utilize a CDN service for djangoproject.com, or at
 least on docs.djangoproject.com? The site is actually quite fast for
 me but I think there is still room for improvement. Cloudflare
 sponsored dozens of open source projects
 , probably they can
 provide free service for django as well.

 Tested from Melbourne, Australia:

 https://www.djangoproject.com/
  Average Ping: 245ms
  Browser: 21 requests, 211KB transferred, Finish: 2.52s,
 DOMContentLoaded: 1.16s, Load: 1.48s

 https://git-scm.com/
  Average Ping: 5ms
  Browser: 42 requests, 351KB transferred, Finish: 717ms,
 DOMContentLoaded: 564ms, Load: 699ms

 Tested on Chrome with "Disable cache" checked (but not the first time
 visit, so DNS query time might not be included).

 Best regards and thanks for all your great work.

>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/548db807-647f-4d0b-99c2-f9f229f7175e%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CANK-yknQ1Auf6CFD-%2B94qoATQ2K%2By0poLw%3DaxyJYjO3PaHOQWA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMGFDKTAVv_3HJCTHqd-vSOFt9-WUvUDEGR8sYuawyVT7MAotQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use CDN for djangoproject.com

2019-02-13 Thread Kye Russell
I’ve been hearing that there are other CDN providers that offer a very
comparable service for a fraction of the cost of CloudFront.

Anyways, at this stage let’s not get bogged down on provider decisions. I’m
curious if anyone has any general objections to a CDN of any kind.

It shouldn’t be that big a deal to automatically invalidate when the docs
are updated. But I’m sure there’s something I’m missing.

On Thu, 14 Feb 2019 at 8:36 am, Cristiano Coelho 
wrote:

> Consider AWS's cloudfront then :)
>
> El martes, 12 de febrero de 2019, 2:34:09 (UTC-5), Florian Apolloner
> escribió:
>>
>> Especially cloudflare is a service we do not want to use. as for the docs
>> only, does the mirror on rtd work better for you? They are probably behind
>> a CDN.
>>
>> Cheers,
>> Florian
>>
>> On Tuesday, February 12, 2019 at 6:43:41 AM UTC+1, Cheng C wrote:
>>>
>>> Hi,
>>>
>>> Is it possible to utilize a CDN service for djangoproject.com, or at
>>> least on docs.djangoproject.com? The site is actually quite fast for me
>>> but I think there is still room for improvement. Cloudflare sponsored
>>> dozens of open source projects
>>> , probably they can
>>> provide free service for django as well.
>>>
>>> Tested from Melbourne, Australia:
>>>
>>> https://www.djangoproject.com/
>>>  Average Ping: 245ms
>>>  Browser: 21 requests, 211KB transferred, Finish: 2.52s,
>>> DOMContentLoaded: 1.16s, Load: 1.48s
>>>
>>> https://git-scm.com/
>>>  Average Ping: 5ms
>>>  Browser: 42 requests, 351KB transferred, Finish: 717ms,
>>> DOMContentLoaded: 564ms, Load: 699ms
>>>
>>> Tested on Chrome with "Disable cache" checked (but not the first time
>>> visit, so DNS query time might not be included).
>>>
>>> Best regards and thanks for all your great work.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/548db807-647f-4d0b-99c2-f9f229f7175e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANK-yknQ1Auf6CFD-%2B94qoATQ2K%2By0poLw%3DaxyJYjO3PaHOQWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use CDN for djangoproject.com

2019-02-13 Thread Tom Forbes
I would highly recommend cloudflare. It's free, can be set up in 15 minutes
and works really, really well.

On Thu, 14 Feb 2019, 00:36 Cristiano Coelho, 
wrote:

> Consider AWS's cloudfront then :)
>
> El martes, 12 de febrero de 2019, 2:34:09 (UTC-5), Florian Apolloner
> escribió:
>>
>> Especially cloudflare is a service we do not want to use. as for the docs
>> only, does the mirror on rtd work better for you? They are probably behind
>> a CDN.
>>
>> Cheers,
>> Florian
>>
>> On Tuesday, February 12, 2019 at 6:43:41 AM UTC+1, Cheng C wrote:
>>>
>>> Hi,
>>>
>>> Is it possible to utilize a CDN service for djangoproject.com, or at
>>> least on docs.djangoproject.com? The site is actually quite fast for me
>>> but I think there is still room for improvement. Cloudflare sponsored
>>> dozens of open source projects
>>> , probably they can
>>> provide free service for django as well.
>>>
>>> Tested from Melbourne, Australia:
>>>
>>> https://www.djangoproject.com/
>>>  Average Ping: 245ms
>>>  Browser: 21 requests, 211KB transferred, Finish: 2.52s,
>>> DOMContentLoaded: 1.16s, Load: 1.48s
>>>
>>> https://git-scm.com/
>>>  Average Ping: 5ms
>>>  Browser: 42 requests, 351KB transferred, Finish: 717ms,
>>> DOMContentLoaded: 564ms, Load: 699ms
>>>
>>> Tested on Chrome with "Disable cache" checked (but not the first time
>>> visit, so DNS query time might not be included).
>>>
>>> Best regards and thanks for all your great work.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/548db807-647f-4d0b-99c2-f9f229f7175e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFNZOJNvAvUxZbsi5TGkHzGw3TuXjstMtac-woB9x_1iNZvdhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use CDN for djangoproject.com

2019-02-13 Thread Cristiano Coelho
Consider AWS's cloudfront then :)

El martes, 12 de febrero de 2019, 2:34:09 (UTC-5), Florian Apolloner 
escribió:
>
> Especially cloudflare is a service we do not want to use. as for the docs 
> only, does the mirror on rtd work better for you? They are probably behind 
> a CDN.
>
> Cheers,
> Florian
>
> On Tuesday, February 12, 2019 at 6:43:41 AM UTC+1, Cheng C wrote:
>>
>> Hi,
>>
>> Is it possible to utilize a CDN service for djangoproject.com, or at 
>> least on docs.djangoproject.com? The site is actually quite fast for me 
>> but I think there is still room for improvement. Cloudflare sponsored 
>> dozens of open source projects 
>> , probably they can 
>> provide free service for django as well.
>>
>> Tested from Melbourne, Australia:
>>
>> https://www.djangoproject.com/
>>  Average Ping: 245ms
>>  Browser: 21 requests, 211KB transferred, Finish: 2.52s, 
>> DOMContentLoaded: 1.16s, Load: 1.48s
>>
>> https://git-scm.com/
>>  Average Ping: 5ms
>>  Browser: 42 requests, 351KB transferred, Finish: 717ms, 
>> DOMContentLoaded: 564ms, Load: 699ms
>>
>> Tested on Chrome with "Disable cache" checked (but not the first time 
>> visit, so DNS query time might not be included).
>>
>> Best regards and thanks for all your great work. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/548db807-647f-4d0b-99c2-f9f229f7175e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use CDN for djangoproject.com

2019-02-13 Thread Josh Smeaton
Why do we not want to use Cloudflare?

FWIW I agree that the docs site performance is not great (also from 
melbourne) - but I'd still suffer the performance hit over going via RTD 
mirrors for familiarity.


On Tuesday, 12 February 2019 18:34:09 UTC+11, Florian Apolloner wrote:
>
> Especially cloudflare is a service we do not want to use. as for the docs 
> only, does the mirror on rtd work better for you? They are probably behind 
> a CDN.
>
> Cheers,
> Florian
>
> On Tuesday, February 12, 2019 at 6:43:41 AM UTC+1, Cheng C wrote:
>>
>> Hi,
>>
>> Is it possible to utilize a CDN service for djangoproject.com, or at 
>> least on docs.djangoproject.com? The site is actually quite fast for me 
>> but I think there is still room for improvement. Cloudflare sponsored 
>> dozens of open source projects 
>> , probably they can 
>> provide free service for django as well.
>>
>> Tested from Melbourne, Australia:
>>
>> https://www.djangoproject.com/
>>  Average Ping: 245ms
>>  Browser: 21 requests, 211KB transferred, Finish: 2.52s, 
>> DOMContentLoaded: 1.16s, Load: 1.48s
>>
>> https://git-scm.com/
>>  Average Ping: 5ms
>>  Browser: 42 requests, 351KB transferred, Finish: 717ms, 
>> DOMContentLoaded: 564ms, Load: 699ms
>>
>> Tested on Chrome with "Disable cache" checked (but not the first time 
>> visit, so DNS query time might not be included).
>>
>> Best regards and thanks for all your great work. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/285bd588-44a7-4152-a270-7f1be0e5de29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: QuerySet.iterator together with prefetch_related because of chunk_size

2019-02-13 Thread Taylor
I agree that 2 makes sense and isn't a huge usability issue. It looks like 
the PR is ready to go whenever this is 
decided https://github.com/django/django/pull/10707/files

On Monday, January 14, 2019 at 5:29:18 PM UTC-5, Adam Johnson wrote:
>
> I agree with your reasoning, and also favour option 2 now, especially 
> since the default can break on sqlite.
>
> It would also be possible to go through a deprecation period to first 
> raise a warning and not prefetch, before a later version raises an 
> exception, which is probably kinder since previously it was documented that 
> it just was a no-op.
>
> On Mon, 14 Jan 2019 at 19:03, charettes > 
> wrote:
>
>> > This seems reasonable, but would you do in the case chunk_size isn't 
>> explicitly defined - throw an exception?
>>
>> That's would be the plan.
>>
>> > Currently it silently fails to prefetch which means N + 1 queries, so 
>> even prefetching for the default chunk_size of 2000 would be a huge gain in 
>> cases where chunk_size isn't defined.
>>
>> That's assuming related relationships are actually accessed during 
>> iteration over the objects. If it's not currently the case turning that on 
>> would cause P + C extra queries.
>>
>> To summarize here's the options we have:
>>
>> 1. Always turn on the prefetching feature.
>> 2. Require chunk_size to be explicitly specified for a deprecation period 
>> in order to enable the feature.
>>
>> Pros/Cons of 1. is that developers who actually didn't follow the 
>> documentation and/or didn't assert that prefetching didn't work and left 
>> some lingering prefetch_related() will probably see their code perform less 
>> queries but result in a slight increase in memory (given they discard 
>> objects on iterating). This is also likely to break code because of some 
>> backends (e.g. SQLite) query parameters limits (chunk_size=2000 > 1000)[0]
>>
>> Pros/Cons of 2. is that most prefetch_related().iterator() won't break 
>> for developers that followed the documentation and fail for others 
>> requiring them to acknowledge what their code is going to start doing.
>>
>> As I've expressed in my previous messages I'm slightly in favor of 2 even 
>> if it is likely to cause more breakage because of the exceptional situation 
>> where this API should have raised an exception from the beginning.
>>
>> Cheers,
>> Simon
>>
>> [0] https://code.djangoproject.com/ticket/27833
>>
>> Le lundi 14 janvier 2019 09:53:45 UTC-5, Adam Johnson a écrit :
>>>
>>> ...what if we required chunk_size to be explicitly specified when the 
 queryset has prefetch lookups?
>>>
>>>
>>> This seems reasonable, but would you do in the case chunk_size isn't 
>>> explicitly defined - throw an exception? Currently it silently fails to 
>>> prefetch which means N + 1 queries, so even prefetching for the default 
>>> chunk_size of 2000 would be a huge gain in cases where chunk_size isn't 
>>> defined.
>>>
>>> On Sun, 13 Jan 2019 at 02:05, charettes  wrote:
>>>
 Replying to my concerns about the P * C queries.

 Throwing that idea out there but what if we required chunk_size to be 
 explicitly specified when the queryset has prefetch lookups?

 That would at least force the developers to consider how many 
 prefetching queries iterating through the results would require. Plus 
 since 
 the argument was only recently introduced it is less likely to silently 
 cause changes under developers feet.

 Simon

 Le vendredi 26 octobre 2018 20:12:02 UTC-4, charettes a écrit :
>
> Josh, I agree that silently not working is problematic but it has been 
> this way since prefetch_related() was introduced.
>
> Something to keep in mind as well is that silently turning it on would 
> also perform P * C extra queries where P is the number of prefetches 
> requested through prefetch_related() and C the number of chunks the 
> results 
> contains. This is non negligible IMO.
>
> What I'd be in favor off is raising an exception on 
> prefetch_related(*prefetches).iterator() in the next release at least to 
> allow users using this pattern to adjust their code and then ship the 
> optimization with all the warnings related to the interactions between 
> prefetch_related(*prefetches) and iterator(chunk_size) in the next one.
>
> I'm not completely completely against skipping the exception release 
> phase entirely given there might be users out there accessing attributes 
> expected to be prefetched on iterated instances and inadvertently 
> performing tons of queries but the exception phase just feels safer given 
> iterator() is usually used in memory constrained contexts.
>
> Simon
>
> Le vendredi 26 octobre 2018 19:27:55 UTC-4, Josh Smeaton a écrit :
>>
>> I tend to agree with Tobi. Prefetching silently not working on 
>> iterator can be quite confusing, unless you have a good understanding of 

Re: include only columns from selected related models in select_related query

2019-02-13 Thread Josh Smeaton
Personally, I depend on this behaviour, but it's only because I'm aware of 
it. Others would be too though, so we can't just make that change (not that 
you're suggesting that approach).

One approach I think could be good would be:

Book.objects.select_related('author__hometown').defer("author").get(id=4)

Deferring a relation would defer all fields except the key field (which is 
necessary for lazy loading). What do you think?


On Tuesday, 12 February 2019 03:48:00 UTC+11, riccardo.magliocchetti wrote:
>
> Hello Collin, 
>
> Il 11/02/19 17:35, Collin Anderson ha scritto: 
> > So would you "defer" the other columns like "only()"? 
>
> Yeah, something like that 
>
> > If nothing else, you could try using .annotate(F('author__hometown')) 
> (not 
> > sure if that works) or .values('author__hometown') to just get the 
> values 
> > you need. 
>
> Sure but the query would be everything but readable :) 
> The point of a parameter to select_related would be to avoid to type 
> explicitly 
> fields not in select_related and the one in select_related twice. 
>
> > On Mon, Feb 11, 2019 at 5:50 AM Riccardo Magliocchetti < 
> > riccardo.ma...@gmail.com > wrote: 
> > 
> >> Hello, 
> >> 
> >> I'm debugging views leaking lots of memory in django 1.11. It looks 
> like 
> >> there 
> >> is some connections with my usage of select_related(). But that's mail 
> is 
> >> not 
> >> about that, not sure about my findings yet :) 
> >> 
> >> So I have looked again at the select_related documentation here: 
> >> 
> https://docs.djangoproject.com/en/2.1/ref/models/querysets/#select-related 
> >> 
> >> and found this: 
> >> Book.objects.select_related('author__hometown').get(id=4) will cache 
> the 
> >> related 
> >> Person and the related City 
> >> 
> >> Up until now i thought that only the related model i've specified would 
> >> get 
> >> added to selected columns e.g. only the City because of hometown. But 
> it 
> >> looks 
> >> that's not how it is :) 
> >> 
> >> Would it make sense to add a parameter to change select_related 
> behaviour 
> >> to 
> >> include only the columns of the related models specified? That could 
> save 
> >> quite 
> >> a lot of bandwitdh for some use cases. 
> >> 
> >> What do you think? 
> >> 
> >> Thanks 
> >> 
> >> -- 
> >> Riccardo Magliocchetti 
> >> @rmistaken 
> >> 
> >> http://menodizero.it 
> >> 
> >> -- 
> >> You received this message because you are subscribed to the Google 
> Groups 
> >> "Django developers  (Contributions to Django itself)" group. 
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an 
> >> email to django-develop...@googlegroups.com . 
> >> To post to this group, send email to django-d...@googlegroups.com 
> . 
> >> Visit this group at https://groups.google.com/group/django-developers. 
> >> To view this discussion on the web visit 
> >> 
> https://groups.google.com/d/msgid/django-developers/a42050d3-25a2-2f47-c841-918d7d085757%40gmail.com
>  
> >> . 
> >> For more options, visit https://groups.google.com/d/optout. 
> >> 
> > 
>
>
> -- 
> Riccardo Magliocchetti 
> @rmistaken 
>
> http://menodizero.it 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8db815a1-91a8-4dac-bf60-eeca96a0d71e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO FILE

2019-02-13 Thread Adam Johnson
The django documentation can be downloaded as PDF by following the link on
the right of its index page: https://docs.djangoproject.com/en/2.1/

On Wed, 13 Feb 2019 at 08:48, Edward Victorhez 
wrote:

> Good evening, please can I get the PDF note?
>
> On Feb 12, 2019 10:17 AM, "Adam Johnson"  wrote:
>
>> Hi Edward,
>>
>> You probably want the Django "start" page:
>> https://www.djangoproject.com/start/
>>
>> Emailing this mailing list of more than 10,000 addresses for such help is
>> not appropriate. It is for discussion of the creation of Django itself. For
>> other places to go see the "Join the community" header on that page.
>>
>> Thanks,
>>
>> Adam
>>
>> On Mon, 11 Feb 2019 at 22:20, Kosta Dafoulas 
>> wrote:
>>
>>> I’ll give you the files
>>>
>>> On Mon, Feb 11, 2019 at 10:18 AM Edward Victorhez <
>>> edwardvictor...@gmail.com> wrote:
>>>
 PLEASE I  AM NEW IN DJANGO, PLEASE I NEED THE FILES THAT WILL PUT ME
 THROUGH

 --
 You received this message because you are subscribed to the Google
 Groups "Django developers (Contributions to Django itself)" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-developers+unsubscr...@googlegroups.com.
 To post to this group, send email to django-developers@googlegroups.com
 .
 Visit this group at https://groups.google.com/group/django-developers.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-developers/4bc81098-6d8b-43dd-bafe-2412061a292a%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> V/r,
>>> Kosta
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/CAFh%3DpPe-A6tHRd-DDd2kEe3efA32bLBCrFZNbi-yD6KomOMBYw%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Adam
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/CAMyDDM3D%3DTMk6bq-St3548W5za%3DOMTWOQRKqt-p-ebQajPiwxQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CACzrH1C1THVZjzV5hW0EgGFCPTckpUnA9COsj0kH2HmSP5%3DjqQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0gu5G0YM-JHHvesXK0gcMWf9g%2BjRk0JGZP-qa%3DpcOLPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO FILE

2019-02-13 Thread Edward Victorhez
Good evening, please can I get the PDF note?

On Feb 12, 2019 10:17 AM, "Adam Johnson"  wrote:

> Hi Edward,
>
> You probably want the Django "start" page: https://www.
> djangoproject.com/start/
>
> Emailing this mailing list of more than 10,000 addresses for such help is
> not appropriate. It is for discussion of the creation of Django itself. For
> other places to go see the "Join the community" header on that page.
>
> Thanks,
>
> Adam
>
> On Mon, 11 Feb 2019 at 22:20, Kosta Dafoulas 
> wrote:
>
>> I’ll give you the files
>>
>> On Mon, Feb 11, 2019 at 10:18 AM Edward Victorhez <
>> edwardvictor...@gmail.com> wrote:
>>
>>> PLEASE I  AM NEW IN DJANGO, PLEASE I NEED THE FILES THAT WILL PUT ME
>>> THROUGH
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-developers+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-developers@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-developers/4bc81098-6d8b-43dd-bafe-
>>> 2412061a292a%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> V/r,
>> Kosta
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-developers/CAFh%3DpPe-A6tHRd-DDd2kEe3efA32bLBCrFZNbi-
>> yD6KomOMBYw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Adam
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/CAMyDDM3D%3DTMk6bq-St3548W5za%
> 3DOMTWOQRKqt-p-ebQajPiwxQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CACzrH1C1THVZjzV5hW0EgGFCPTckpUnA9COsj0kH2HmSP5%3DjqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.