mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-23 15:54:12 +03:00
automatically update INTERNAL_IPS (#600)
* change local config to automatically update INTERNAL_IPS when developping with docker * Update local.py Move import to top * Update local.py Bug fix and remove blank line * Update local.py * flake8 compliance * add env var check before updating INTERNAL_IPS * flake8 compliance * flake8 compliance
This commit is contained in:
parent
3d2385a3b6
commit
13faa21799
|
@ -9,6 +9,8 @@ Local settings
|
|||
"""
|
||||
|
||||
from .common import * # noqa
|
||||
import socket
|
||||
import os
|
||||
|
||||
# DEBUG
|
||||
# ------------------------------------------------------------------------------
|
||||
|
@ -47,7 +49,11 @@ CACHES = {
|
|||
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
|
||||
INSTALLED_APPS += ('debug_toolbar', )
|
||||
|
||||
INTERNAL_IPS = ('127.0.0.1', '10.0.2.2',)
|
||||
INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]
|
||||
# tricks to have debug toolbar when developing with docker
|
||||
if os.environ.get('USE_DOCKER') == 'yes':
|
||||
ip = socket.gethostbyname(socket.gethostname())
|
||||
INTERNAL_IPS += [ip[:-1]+"1"]
|
||||
|
||||
DEBUG_TOOLBAR_CONFIG = {
|
||||
'DISABLE_PANELS': [
|
||||
|
|
|
@ -22,6 +22,7 @@ services:
|
|||
- postgres
|
||||
environment:
|
||||
- POSTGRES_USER={{cookiecutter.project_slug}}
|
||||
- USE_DOCKER=yes
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
|
|
Loading…
Reference in New Issue
Block a user