Opened 3 years ago

Closed 3 years ago

#32953 closed New feature (wontfix)

Enable optional auto-reloading for testserver

Reported by: Igor Bakutin Owned by: Igor Bakutin
Component: Core (Management commands) Version: 4.0
Severity: Normal Keywords: testserver reloader
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django/core/management/commands/testserver.py:39 has the following comment

# Run the development server. Turn off auto-reloading because it causes
# a strange error -- it causes this handle() method to be called
# multiple times.

The task is to fix the issue and add optional --autoreload flag to the command

Change History (4)

comment:1 by Igor Bakutin, 3 years ago

Type: UncategorizedNew feature

comment:2 by Igor Bakutin, 3 years ago

Owner: changed from Igor Bakutin to Igor Bakutin

in reply to:  description comment:3 by Mariusz Felisiak, 3 years ago

Thanks for the ticket.

Replying to Igor Bakutin:

django/core/management/commands/testserver.py:39 has the following comment

# Run the development server. Turn off auto-reloading because it causes
# a strange error -- it causes this handle() method to be called
# multiple times.

However, this comment was added in 9c55bbdef7f1717aa17f7ca17cb2396522426310 and that doesn't mean that 14 years later it's still a desirable feature. testserver is intended to work with a database snapshot (loaded from fixtures) so it can be really fragile for any changes in models or migrations. I'm not sure if we can support it in a bulletproof way 🤔.

comment:4 by Carlton Gibson, 3 years ago

Resolution: wontfix
Status: assignedclosed

I too think this is probably a mistake to add. (If anything deprecating the testserver command would be the way to go, rather than adding surface area here.) If folks want autoreloading runserver should be sufficient.

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