Opened 5 years ago
Closed 5 years ago
#31339 closed Bug (wontfix)
ORM call in app.ready in ASGI mode causes errors.
Reported by: | Lachlan Cannon | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 3.0 |
Severity: | Normal | Keywords: | asgi |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It appears that calling the ORM in app.ready in ASGI mode causes a SynchronousOnlyOperation exception.
See more details in the Django forum post https://forum.djangoproject.com/t/orm-call-in-app-ready-in-asgi-mode/1348
Change History (2)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Summary: | ORM call in app.ready in ASGI mode causes errors → ORM call in app.ready in ASGI mode causes errors. |
I totally agree with Simon, we've already warned in docs about running queries in app.ready()
and we shouldn't encourage them is ASGI.
Note:
See TracTickets
for help on using tickets.
I think
app.ready
is considered module loading time and thus query should not be performed during that time.Given the explicit warning in the docs I'm inclined to close this ticket as wontfix.