Re: Add subdomains of localhost to ALLOWED_HOSTS in DEBUG mode

2019-11-22 Thread Adam Johnson
Spec seems clear enough. Seems like it’s still an open bug in Firefox:
https://bugzilla.mozilla.org/show_bug.cgi?id=1433933

Can you reopen the ticket, add the spec link to the description, and open a
PR? Thanks!

On Fri, 22 Nov 2019 at 06:31, אורי  wrote:

> 2090?
> אורי
> u...@speedy.net
>
>
> On Thu, Nov 21, 2019 at 11:58 PM gordon  wrote:
>
>> Spec:
>>
>>- https://tools.ietf.org/html/rfc6761#section-6.3
>>
>> It didn't seem to work on IE edge.  At the rate of browser updates I
>> expect all browsers to support this by 2090.  But it does make development
>> on Chrome nice now =)
>>
>> On Thu, Nov 21, 2019 at 4:49 PM Adam Johnson  wrote:
>>
>>> I’m all in favour of making development easier. Would be in favour of
>>> this if I could see a source :) Also can you check the behaviour in more
>>> browsers than Chrom(e|ium)? :)
>>>
>>> On Thu, 21 Nov 2019 at 21:40, Gordon  wrote:
>>>
 Good afternoon,

 It seems pretty straightforward to me as a win with no downsides.
 Chrome resolves subdomains of localhost as localhost.  I did a little
 searching (but forgot to keep the sources) and discovered that this
 behavior was intentional and spec compliant.  This is extremely handy for
 local development since it allows one to test subdomains without fooling
 with network DNS or modifying host files.

 I opened ticket https://code.djangoproject.com/ticket/31010 and was
 asked to canvas for opinions.

 I think that updating the handling of ALLOWED_HOSTS in
 HttpRequest.get_host()from:

 # Allow variants of localhost if ALLOWED_HOSTS is empty and 
 DEBUG=True.
 allowed_hosts = settings.ALLOWED_HOSTS
 if settings.DEBUG and not allowed_hosts:
 allowed_hosts = ['localhost', '127.0.0.1', '[::1]']


 to

 # Allow variants of localhost if ALLOWED_HOSTS is empty and 
 DEBUG=True.
 allowed_hosts = settings.ALLOWED_HOSTS
 if settings.DEBUG and not allowed_hosts:
 allowed_hosts = ['.localhost', '127.0.0.1', '[::1]']


 would be safe and support this pattern without requiring any changes to
 settings files which is quite nice for new projects.  Please let me know
 what you think =)

 Thanks,
 Gordon



 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-developers/b9e276f0-76f1-4a9c-be22-cb7286c20ec5%40googlegroups.com
 
 .

>>> --
>>> Adam
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-developers/xcoAF9Gm_dI/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> django-developers+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/CAMyDDM0ufpyu50t_tbACPrEwJ94LYTWGyfywGzooA7%3D3pVnXBw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/CAJc1Fha6-BVPtehCQQXjZaAdbeqhoUzxLVkW-06fnZD1VWfyEg%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CABD5YeGiXYXGwfWEC5z8oGvr7pwGVz%2BYgbCwAcis0kkMrBw2%3Dw%40mail.gmail.com
> 
> .
>
-- 
Adam

-- 
You received this 

Re: Add subdomains of localhost to ALLOWED_HOSTS in DEBUG mode

2019-11-21 Thread אורי
2090?
אורי
u...@speedy.net


On Thu, Nov 21, 2019 at 11:58 PM gordon  wrote:

> Spec:
>
>- https://tools.ietf.org/html/rfc6761#section-6.3
>
> It didn't seem to work on IE edge.  At the rate of browser updates I
> expect all browsers to support this by 2090.  But it does make development
> on Chrome nice now =)
>
> On Thu, Nov 21, 2019 at 4:49 PM Adam Johnson  wrote:
>
>> I’m all in favour of making development easier. Would be in favour of
>> this if I could see a source :) Also can you check the behaviour in more
>> browsers than Chrom(e|ium)? :)
>>
>> On Thu, 21 Nov 2019 at 21:40, Gordon  wrote:
>>
>>> Good afternoon,
>>>
>>> It seems pretty straightforward to me as a win with no downsides.
>>> Chrome resolves subdomains of localhost as localhost.  I did a little
>>> searching (but forgot to keep the sources) and discovered that this
>>> behavior was intentional and spec compliant.  This is extremely handy for
>>> local development since it allows one to test subdomains without fooling
>>> with network DNS or modifying host files.
>>>
>>> I opened ticket https://code.djangoproject.com/ticket/31010 and was
>>> asked to canvas for opinions.
>>>
>>> I think that updating the handling of ALLOWED_HOSTS in
>>> HttpRequest.get_host()from:
>>>
>>> # Allow variants of localhost if ALLOWED_HOSTS is empty and 
>>> DEBUG=True.
>>> allowed_hosts = settings.ALLOWED_HOSTS
>>> if settings.DEBUG and not allowed_hosts:
>>> allowed_hosts = ['localhost', '127.0.0.1', '[::1]']
>>>
>>>
>>> to
>>>
>>> # Allow variants of localhost if ALLOWED_HOSTS is empty and 
>>> DEBUG=True.
>>> allowed_hosts = settings.ALLOWED_HOSTS
>>> if settings.DEBUG and not allowed_hosts:
>>> allowed_hosts = ['.localhost', '127.0.0.1', '[::1]']
>>>
>>>
>>> would be safe and support this pattern without requiring any changes to
>>> settings files which is quite nice for new projects.  Please let me know
>>> what you think =)
>>>
>>> Thanks,
>>> Gordon
>>>
>>>
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/b9e276f0-76f1-4a9c-be22-cb7286c20ec5%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> Adam
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-developers/xcoAF9Gm_dI/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> django-developers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/CAMyDDM0ufpyu50t_tbACPrEwJ94LYTWGyfywGzooA7%3D3pVnXBw%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAJc1Fha6-BVPtehCQQXjZaAdbeqhoUzxLVkW-06fnZD1VWfyEg%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CABD5YeGiXYXGwfWEC5z8oGvr7pwGVz%2BYgbCwAcis0kkMrBw2%3Dw%40mail.gmail.com.


Re: Add subdomains of localhost to ALLOWED_HOSTS in DEBUG mode

2019-11-21 Thread Harro
I assume that just localhost still works with the above change?

If so then the fact that IE edge does not support it is no reason to not change 
it because nothing changes with the current usage.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/dbed920a-cedd-4e15-ab9b-1ffc6247ffe6%40googlegroups.com.


Re: Add subdomains of localhost to ALLOWED_HOSTS in DEBUG mode

2019-11-21 Thread gordon
Spec:

   - https://tools.ietf.org/html/rfc6761#section-6.3

It didn't seem to work on IE edge.  At the rate of browser updates I expect
all browsers to support this by 2090.  But it does make development on
Chrome nice now =)

On Thu, Nov 21, 2019 at 4:49 PM Adam Johnson  wrote:

> I’m all in favour of making development easier. Would be in favour of this
> if I could see a source :) Also can you check the behaviour in more
> browsers than Chrom(e|ium)? :)
>
> On Thu, 21 Nov 2019 at 21:40, Gordon  wrote:
>
>> Good afternoon,
>>
>> It seems pretty straightforward to me as a win with no downsides.  Chrome
>> resolves subdomains of localhost as localhost.  I did a little searching
>> (but forgot to keep the sources) and discovered that this behavior was
>> intentional and spec compliant.  This is extremely handy for local
>> development since it allows one to test subdomains without fooling with
>> network DNS or modifying host files.
>>
>> I opened ticket https://code.djangoproject.com/ticket/31010 and was
>> asked to canvas for opinions.
>>
>> I think that updating the handling of ALLOWED_HOSTS in
>> HttpRequest.get_host()from:
>>
>> # Allow variants of localhost if ALLOWED_HOSTS is empty and 
>> DEBUG=True.
>> allowed_hosts = settings.ALLOWED_HOSTS
>> if settings.DEBUG and not allowed_hosts:
>> allowed_hosts = ['localhost', '127.0.0.1', '[::1]']
>>
>>
>> to
>>
>> # Allow variants of localhost if ALLOWED_HOSTS is empty and 
>> DEBUG=True.
>> allowed_hosts = settings.ALLOWED_HOSTS
>> if settings.DEBUG and not allowed_hosts:
>> allowed_hosts = ['.localhost', '127.0.0.1', '[::1]']
>>
>>
>> would be safe and support this pattern without requiring any changes to
>> settings files which is quite nice for new projects.  Please let me know
>> what you think =)
>>
>> Thanks,
>> Gordon
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/b9e276f0-76f1-4a9c-be22-cb7286c20ec5%40googlegroups.com
>> 
>> .
>>
> --
> Adam
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-developers/xcoAF9Gm_dI/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAMyDDM0ufpyu50t_tbACPrEwJ94LYTWGyfywGzooA7%3D3pVnXBw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAJc1Fha6-BVPtehCQQXjZaAdbeqhoUzxLVkW-06fnZD1VWfyEg%40mail.gmail.com.


Re: Add subdomains of localhost to ALLOWED_HOSTS in DEBUG mode

2019-11-21 Thread Adam Johnson
I’m all in favour of making development easier. Would be in favour of this
if I could see a source :) Also can you check the behaviour in more
browsers than Chrom(e|ium)? :)

On Thu, 21 Nov 2019 at 21:40, Gordon  wrote:

> Good afternoon,
>
> It seems pretty straightforward to me as a win with no downsides.  Chrome
> resolves subdomains of localhost as localhost.  I did a little searching
> (but forgot to keep the sources) and discovered that this behavior was
> intentional and spec compliant.  This is extremely handy for local
> development since it allows one to test subdomains without fooling with
> network DNS or modifying host files.
>
> I opened ticket https://code.djangoproject.com/ticket/31010 and was asked
> to canvas for opinions.
>
> I think that updating the handling of ALLOWED_HOSTS in
> HttpRequest.get_host()from:
>
> # Allow variants of localhost if ALLOWED_HOSTS is empty and 
> DEBUG=True.
> allowed_hosts = settings.ALLOWED_HOSTS
> if settings.DEBUG and not allowed_hosts:
> allowed_hosts = ['localhost', '127.0.0.1', '[::1]']
>
>
> to
>
> # Allow variants of localhost if ALLOWED_HOSTS is empty and 
> DEBUG=True.
> allowed_hosts = settings.ALLOWED_HOSTS
> if settings.DEBUG and not allowed_hosts:
> allowed_hosts = ['.localhost', '127.0.0.1', '[::1]']
>
>
> would be safe and support this pattern without requiring any changes to
> settings files which is quite nice for new projects.  Please let me know
> what you think =)
>
> Thanks,
> Gordon
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/b9e276f0-76f1-4a9c-be22-cb7286c20ec5%40googlegroups.com
> 
> .
>
-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0ufpyu50t_tbACPrEwJ94LYTWGyfywGzooA7%3D3pVnXBw%40mail.gmail.com.


Add subdomains of localhost to ALLOWED_HOSTS in DEBUG mode

2019-11-21 Thread Gordon
Good afternoon,

It seems pretty straightforward to me as a win with no downsides.  Chrome 
resolves subdomains of localhost as localhost.  I did a little searching 
(but forgot to keep the sources) and discovered that this behavior was 
intentional and spec compliant.  This is extremely handy for local 
development since it allows one to test subdomains without fooling with 
network DNS or modifying host files.

I opened ticket https://code.djangoproject.com/ticket/31010 and was asked 
to canvas for opinions.

I think that updating the handling of ALLOWED_HOSTS in 
HttpRequest.get_host()from:

# Allow variants of localhost if ALLOWED_HOSTS is empty and DEBUG=True.
allowed_hosts = settings.ALLOWED_HOSTS
if settings.DEBUG and not allowed_hosts:
allowed_hosts = ['localhost', '127.0.0.1', '[::1]']


to

# Allow variants of localhost if ALLOWED_HOSTS is empty and DEBUG=True.
allowed_hosts = settings.ALLOWED_HOSTS
if settings.DEBUG and not allowed_hosts:
allowed_hosts = ['.localhost', '127.0.0.1', '[::1]']


would be safe and support this pattern without requiring any changes to 
settings files which is quite nice for new projects.  Please let me know 
what you think =)

Thanks,
Gordon



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/b9e276f0-76f1-4a9c-be22-cb7286c20ec5%40googlegroups.com.