Hello,

If changes are made in this direction, allowing ip address and ip network 
objects in addition to strings would likely be the best API: 
https://docs.python.org/3/library/ipaddress.html#ipaddress.ip_network 
<https://docs.python.org/3/library/ipaddress.html#ipaddress.ip_network>

That module is new in Python 3 but since Django is on the verge of dropping 
support for Python 2, the fancy new toys are available now :-)

-- 
Aymeric.

> On 16 Nov 2016, at 23:29, Thomas Turner <[email protected]> wrote:
> 
> Hi
> 
> The other day I raise a ticket to do with ALLOWED_HOSTS and it was suggested 
> that I post on this group before creating a patch
> The ticket is https://code.djangoproject.com/ticket/27485 
> <https://code.djangoproject.com/ticket/27485>
> 
> The problem
> 
> Now that Django 1.10.3 forces ALLOWED_HOSTS on with debug I have a problem.
> The problem is that when I developing I use an ip-address range of 
> 192.168.1.*. 
> The Ip-address can change depending on the computer I use.
> so I required the ability to add wildcard partly in an hostname.
> ie 
> ALLOWED_HOSTS = ['192.168.1.*', '.mydomain.com']
> I have seen this solution that doesn't require Django to be changed however I 
> don't like it as I feel this could be a security issue
> ​http://stackoverflow.com/questions/37031749/django-allowed-hosts-ips-range
> 
> I happy to do a patch for this. What do people think?
> 
> Tom
> 
> 
> 
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/django-developers 
> <https://groups.google.com/group/django-developers>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/7c03baf9-8d87-4716-be66-f6a642721a77%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-developers/7c03baf9-8d87-4716-be66-f6a642721a77%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <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 [email protected].
To post to this group, send email to [email protected].
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/C401E4F8-F86A-4AD7-A70C-BBB7FE6C8E03%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.
  • #27485... Thomas Turner
    • #... Yo-Yo Ma
      • ... Raphaël Barrois
    • R... Aymeric Augustin
    • R... 'Tom Evans' via Django developers (Contributions to Django itself)
      • ... Florian Apolloner
        • ... 'Tom Evans' via Django developers (Contributions to Django itself)
          • ... Tobias McNulty
    • R... Thomas Turner

Reply via email to