Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-28 Thread Tobias McNulty
There is a non-development use case here, which is being able to accept the IP range for a subnet used in an EC2 VPC (used by load balancers for health checks). Sure, I could iterate through all the potential IPs and add them, divine a way

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-23 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Sat, Nov 19, 2016 at 1:01 AM, Florian Apolloner wrote: > On Thursday, November 17, 2016 at 5:07:07 PM UTC+1, Tom Evans wrote: >> >> Or: >> from socket import gethostname, gethostbyname >> ALLOWED_HOSTS = [ gethostname(), gethostbyname(gethostname()), ] > > > That a) adds your hostname and b

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-18 Thread Florian Apolloner
On Thursday, November 17, 2016 at 5:07:07 PM UTC+1, Tom Evans wrote: > > Or: > from socket import gethostname, gethostbyname > ALLOWED_HOSTS = [ gethostname(), gethostbyname(gethostname()), ] > That a) adds your hostname and b) (assuming you properly configured your system) 127.0.0.1 -- s

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-17 Thread Thomas Turner
Thank you all. I will have a look to see if I can do it without patching. Tom On Thursday, November 17, 2016 at 12:42:56 AM UTC, Thomas Turner 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

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-17 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Wed, Nov 16, 2016 at 10:29 PM, Thomas Turner 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 > > The problem > > Now that Django 1.10.3 fo

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-17 Thread Aymeric Augustin
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 That modul

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-17 Thread Raphaƫl Barrois
On Wed, 16 Nov 2016 20:32:34 -0800 (PST) Yo-Yo Ma wrote: > I'm not a fan of adding more complexity, for a couple reasons: > > 1) you have the ['*'] option for local / office development > 2) you can just add a record to /etc/hosts to point to the server and then > use a name like e.g., local-of

#27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-16 Thread Yo-Yo Ma
I'm not a fan of adding more complexity, for a couple reasons: 1) you have the ['*'] option for local / office development 2) you can just add a record to /etc/hosts to point to the server and then use a name like e.g., local-office - just update the record to point to whatever IP you're using s

#27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-16 Thread Thomas Turner
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 The problem Now that Django 1.10.3 forces ALLOWED_HOSTS on with debug I have a problem. The problem is that