"""Gunicorn configuration file used by gunserver's Gunicorn subprocess.

This module is not designed to be imported directly, but provided as
Gunicorn's configuration file.
"""

import os
import sys

import django
import gunicorn


# General configs.
logger_class = 'djgunicorn.logging.GunicornLogger'


def post_worker_init(worker):
    """Hook into Gunicorn to display message after launching.

    This mimics the behaviour of Django's stock runserver command.
    """
    quit_command = 'CTRL-BREAK' if sys.platform == 'win32' else 'CONTROL-C'
    sys.stdout.write(
        "Django version {djangover}, Gunicorn version {gunicornver}, "
        "using settings {settings!r}\n"
        "Starting development server at http://{addrport}/\n"
        "Quit the server with {quit_command}.\n".format(
            djangover=django.get_version(),
            gunicornver=gunicorn.__version__,
            settings=os.environ.get('DJANGO_SETTINGS_MODULE'),
            addrport=worker.cfg.bind[0],
            quit_command=quit_command,
        ),
    )


def worker_int(worker):
    """Hook into Gunicorn to display message when worker gets an interruption.

    The purpose of this hook is purely cosmetic: we want a newline when the
    worker reloads. This has an unintended side effect to display an extra
    newline after the server quits, but it is relatively unimportant.
    """
    sys.stdout.write('\n')

@@ -718,26 +718,14 @@
  at 
-http://%7Baddrport%7D/
+%7Burls%7D
 %5Cn%22%0A
@@ -950,17 +950,56 @@
     
-addrport=
+urls=', '.join('http://%7B0%7D/'.format(b) for b in 
 work
@@ -1013,11 +1013,9 @@
 bind
-%5B0%5D
+)
 ,%0A  

Allow multiple bind sockets