mirror of
				https://github.com/cookiecutter/cookiecutter-django.git
				synced 2025-11-04 01:47:28 +03:00 
			
		
		
		
	Add all internal IPs for multiple docker networks (#1520)
* Add all internal IPs for multiple docker networks When developing with modified docker-compose.yml that contains multiple network definitions, all networks gateways of the created container should be added to INTERNAL_IPS, otherwise Django-Debug-Toolbar will not work. * Add @flyudvik to contributors
This commit is contained in:
		
							parent
							
								
									0bd019deb0
								
							
						
					
					
						commit
						6c8538abfe
					
				| 
						 | 
				
			
			@ -116,6 +116,7 @@ Listed in alphabetical order.
 | 
			
		|||
  Luis Nell                `@originell`_
 | 
			
		||||
  Lukas Klein
 | 
			
		||||
  Lyla Fischer
 | 
			
		||||
  Malik Sulaimanov         `@flyudvik`_                  @flyudvik
 | 
			
		||||
  Martin Blech
 | 
			
		||||
  Mathijs Hoogland         `@MathijsHoogland`_
 | 
			
		||||
  Matt Braymer-Hayes       `@mattayes`_                  @mattayes
 | 
			
		||||
| 
						 | 
				
			
			@ -196,6 +197,7 @@ Listed in alphabetical order.
 | 
			
		|||
.. _@eraldo: https://github.com/eraldo
 | 
			
		||||
.. _@eriol: https://github.com/eriol
 | 
			
		||||
.. _@eyadsibai: https://github.com/eyadsibai
 | 
			
		||||
.. _@flyudvik: https://github.com/flyudvik
 | 
			
		||||
.. _@garry-cairns: https://github.com/garry-cairns
 | 
			
		||||
.. _@garrypolley: https://github.com/garrypolley
 | 
			
		||||
.. _@goldhand: https://github.com/goldhand
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,8 +64,8 @@ INTERNAL_IPS = ['127.0.0.1', '10.0.2.2']
 | 
			
		|||
import socket
 | 
			
		||||
import os
 | 
			
		||||
if os.environ.get('USE_DOCKER') == 'yes':
 | 
			
		||||
    ip = socket.gethostbyname(socket.gethostname())
 | 
			
		||||
    INTERNAL_IPS += [ip[:-1] + '1']
 | 
			
		||||
    hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
 | 
			
		||||
    INTERNAL_IPS += [ip[:-1] + '1' for ip in ips]
 | 
			
		||||
{%- endif %}
 | 
			
		||||
 | 
			
		||||
# django-extensions
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user