dcramer / django-devserver

A drop-in replacement for Django's runserver.
BSD 3-Clause "New" or "Revised" License
1.27k stars 158 forks source link

Django 1.8, key error for 'use_ipv6' when running `./manage.py runserver` #115

Closed tankorsmash closed 8 years ago

tankorsmash commented 9 years ago

The fix is to change commands/runserver.py:206 from

                 run(self.addr, int(self.port), app, mixin, ipv6=options['use_ipv6'])

to either

                run(self.addr, int(self.port), app, mixin, ipv6=options.get('use_ipv6', False))

or

                run(self.addr, int(self.port), app, mixin, ipv6=self.use_ipv6)

Not at all familiar with the code from devserver, so I didn't want to make a pull request.

  File "./manage.py", line 18, in <module>
    execute_from_command_line()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/devserver/management/commands/runserver.py", line 91, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 49, in execute
    super(Command, self).execute(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/devserver/management/commands/runserver.py", line 102, in handle
    return super(Command, self).handle(addrport=addrport, *args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 88, in handle
    self.run(**options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 99, in run
    self.inner_run(None, **options)
  File "/usr/local/lib/python2.7/dist-packages/devserver/management/commands/runserver.py", line 206, in inner_run
    run(self.addr, int(self.port), app, mixin, ipv6=options['use_ipv6'])
    KeyError: 'use_ipv6'
softshape commented 9 years ago

I'm getting the same error on Django 1.8 after setup.

nealtodd commented 9 years ago

Fixed via #114