Skip to content

Commit 481b01f

Browse files
committed
Django 1.8 doesn't have the --wsgi-app argument
1 parent e87d23d commit 481b01f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

devserver/management/commands/runserver.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def __init__(self, *args, **kwargs):
5959
dest='use_dozer',
6060
default=False,
6161
help='Enable the Dozer memory debugging middleware.'),
62+
}
63+
64+
ADDITIONAL_ARGUMENTS_LT_18 = {
6265
'--wsgi-app': dict(
6366
dest='wsgi_app',
6467
default=None,
@@ -74,12 +77,16 @@ def __init__(self, *args, **kwargs):
7477
help='Tells Django to NOT automatically serve static files at STATIC_URL.')
7578
})
7679

80+
7781
class Command(BaseCommand):
7882
if BaseCommand.option_list:
7983
# Handle Django < 1.8
84+
additional_arguments = dict(ADDITIONAL_ARGUMENTS)
85+
additional_arguments.update(ADDITIONAL_ARGUMENTS_LT_18)
86+
8087
option_list = BaseCommand.option_list + (
8188
make_option(name, **kwargs)
82-
for name, kwargs in ADDITIONAL_ARGUMENTS.items()
89+
for name, kwargs in additional_arguments.items()
8390
)
8491

8592
help = "Starts a lightweight Web server for development which outputs additional debug information."
@@ -115,7 +122,7 @@ def run_from_argv(self, argv):
115122
args = cmd_options.pop('args', ())
116123
else:
117124
options, args = parser.parse_args(argv[2:], options)
118-
cmd_options = var(options)
125+
cmd_options = vars(options)
119126

120127
handle_default_options(options)
121128
self.execute(*args, **options.__dict__)

0 commit comments

Comments
 (0)