Opened 3 months ago

Closed 13 days 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

Description

In the interests of keeping code modular, we do not use manage.py 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 3 months ago.
Traceback for import error

Download all attachments as: .zip

Change History (8)

Changed 3 months ago by Kit Darko

Attachment: traceback.txt added

Traceback for import error

comment:1 Changed 3 months ago by Tim Graham

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 Changed 2 months ago by Yusuke Miyazaki

Owner: changed from nobody to Yusuke Miyazaki
Status: newassigned

comment:3 Changed 2 months ago by Yusuke Miyazaki

Has patch: set

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

comment:4 Changed 2 months ago by Tim Graham

Needs tests: set

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

comment:5 Changed 2 months ago by Yusuke Miyazaki

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

comment:6 Changed 2 months ago by Tim Graham

Needs tests: unset

comment:7 Changed 13 days ago by Tim Graham <timograham@…>

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