Ticket #21358: 21358.diff

File 21358.diff, 1.5 KB (added by Claude Paroz, 11 years ago)
  • django/core/management/commands/runserver.py

    diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
    index 402b3d3..503cff2 100644
    a b  
     1from __future__ import unicode_literals
     2
    13from optparse import make_option
    24from datetime import datetime
    35import errno
    import socket  
    911from django.core.management.base import BaseCommand, CommandError
    1012from django.core.servers.basehttp import run, get_internal_wsgi_application
    1113from django.utils import autoreload
     14from django.utils import six
    1215
    1316naiveip_re = re.compile(r"""^(?:
    1417(?P<addr>
    class Command(BaseCommand):  
    9699
    97100        self.stdout.write("Validating models...\n\n")
    98101        self.validate(display_num_errors=True)
     102        now = datetime.now().strftime('%B %d, %Y - %X')
     103        if six.PY2:
     104            now = now.decode('utf-8')
     105
    99106        self.stdout.write((
    100107            "%(started_at)s\n"
    101108            "Django version %(version)s, using settings %(settings)r\n"
    102109            "Starting development server at http://%(addr)s:%(port)s/\n"
    103110            "Quit the server with %(quit_command)s.\n"
    104111        ) % {
    105             "started_at": datetime.now().strftime('%B %d, %Y - %X'),
     112            "started_at": now,
    106113            "version": self.get_version(),
    107114            "settings": settings.SETTINGS_MODULE,
    108115            "addr": '[%s]' % self.addr if self._raw_ipv6 else self.addr,
Back to Top