[Django] #28501: django runserver crashes when run as a module

8 views
Skip to first unread message

Django

unread,
Aug 15, 2017, 9:52:02 PM8/15/17
to django-...@googlegroups.com
#28501: django runserver crashes when run as a module
-----------------------------------------+------------------------
Reporter: Chris Darko | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/28501>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 15, 2017, 9:52:48 PM8/15/17
to django-...@googlegroups.com
#28501: django runserver crashes when run as a module
-------------------------------+--------------------------------------

Reporter: Chris Darko | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Chris Darko):

* Attachment "traceback.txt" added.

Traceback for import error

Django

unread,
Aug 22, 2017, 5:04:20 PM8/22/17
to django-...@googlegroups.com
#28501: "python -m django runserver" crashes
-------------------------------------+-------------------------------------
Reporter: Kit Darko | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Core (Management commands)
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


Comment:

It looks like something to do with the autoreloader.

--
Ticket URL: <https://code.djangoproject.com/ticket/28501#comment:1>

Django

unread,
Sep 5, 2017, 5:45:54 PM9/5/17
to django-...@googlegroups.com
#28501: "python -m django runserver" crashes
-------------------------------------+-------------------------------------
Reporter: Kit Darko | Owner: Yusuke
| Miyazaki
Type: Bug | Status: assigned

Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Yusuke Miyazaki):

* owner: nobody => Yusuke Miyazaki
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28501#comment:2>

Django

unread,
Sep 5, 2017, 6:02:31 PM9/5/17
to django-...@googlegroups.com
#28501: "python -m django runserver" crashes
-------------------------------------+-------------------------------------
Reporter: Kit Darko | Owner: Yusuke
| Miyazaki
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Yusuke Miyazaki):

* has_patch: 0 => 1


Comment:

I could reproduce this error, found the problem in the autoreloader, and
wrote a patch. [https://github.com/django/django/pull/9032 PR].

--
Ticket URL: <https://code.djangoproject.com/ticket/28501#comment:3>

Django

unread,
Sep 5, 2017, 6:41:15 PM9/5/17
to django-...@googlegroups.com
#28501: "python -m django runserver" crashes
-------------------------------------+-------------------------------------
Reporter: Kit Darko | Owner: Yusuke
| Miyazaki
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_tests: 0 => 1


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/28501#comment:4>

Django

unread,
Sep 12, 2017, 6:12:22 AM9/12/17
to django-...@googlegroups.com
#28501: "python -m django runserver" crashes
-------------------------------------+-------------------------------------
Reporter: Kit Darko | Owner: Yusuke
| Miyazaki
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Yusuke Miyazaki):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/28501#comment:5>

Django

unread,
Sep 16, 2017, 5:58:56 PM9/16/17
to django-...@googlegroups.com
#28501: "python -m django runserver" crashes
-------------------------------------+-------------------------------------
Reporter: Kit Darko | Owner: Yusuke
| Miyazaki
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28501#comment:6>

Django

unread,
Nov 6, 2017, 10:16:39 AM11/6/17
to django-...@googlegroups.com
#28501: "python -m django runserver" crashes
-------------------------------------+-------------------------------------
Reporter: Kit Darko | Owner: Yusuke
| Miyazaki
Type: Bug | Status: closed

Component: Core (Management | Version: 1.11
commands) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"278d66b94bb443e1c1581e014fee2593a33f338c" 278d66b9]:
{{{
#!CommitTicketReference repository=""
revision="278d66b94bb443e1c1581e014fee2593a33f338c"
Fixed #28501 -- Fixed "python -m django runserver" crash.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28501#comment:7>

Reply all
Reply to author
Forward
0 new messages