Opened 7 years ago

Closed 7 years ago

#28501 closed Bug (fixed)

"python -m django runserver" crashes

Reported by: Kit Darko Owned by: Yusuke Miyazaki
Component: Core (Management commands) Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In the interests of keeping code modular, we do not use runserver in our projects. Instead, we use django-admin runserver.

This works well, but if one wants to run python with some flags, using the django module, it is insufficient.

It would be ideal if python -m django runserver worked, for this reason. Currently, attempting to do so will yield an import error with similar to the attached traceback.

Attachments (1)

traceback.txt (4.4 KB ) - added by Kit Darko 7 years ago.
Traceback for import error

Download all attachments as: .zip

Change History (8)

by Kit Darko, 7 years ago

Attachment: traceback.txt added

Traceback for import error

comment:1 by Tim Graham, 7 years ago

Component: UncategorizedCore (Management commands)
Summary: django runserver crashes when run as a module"python -m django runserver" crashes
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

It looks like something to do with the autoreloader.

comment:2 by Yusuke Miyazaki, 7 years ago

Owner: changed from nobody to Yusuke Miyazaki
Status: newassigned

comment:3 by Yusuke Miyazaki, 7 years ago

Has patch: set

I could reproduce this error, found the problem in the autoreloader, and wrote a patch. PR.

comment:4 by Tim Graham, 7 years ago

Needs tests: set

Is it feasible to add a test? See tests/utils_tests/ for some existing tests.

comment:5 by Yusuke Miyazaki, 7 years ago

I add some tests. Could you review this PR again?

comment:6 by Tim Graham, 7 years ago

Needs tests: unset

comment:7 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In 278d66b9:

Fixed #28501 -- Fixed "python -m django runserver" crash.

Note: See TracTickets for help on using tickets.
Back to Top