Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20474 closed Cleanup/optimization (fixed)

Make django.db importable without side-effects on settings

Reported by: claudep Owned by: nobody
Component: Database layer (models, ORM) Version: master
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

Currently, django.db is not importable without triggering settings configuration, which does harm in certain situations, where imports have then to happen at runtime. I've set up a branch where this behaviour has been fixed:

https://github.com/django/django/pull/1193

Change History (4)

comment:1 Changed 2 years ago by akaariai

  • Triage Stage changed from Unreviewed to Accepted

I don't see any reason to not accept this.

comment:2 Changed 2 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 499a745ae1b53614035b9993b148f32d4ce3f138:

Fixed #20474 -- Proxied and deprecated django.db.backend

comment:3 Changed 2 years ago by Claude Paroz <claude@…>

In 2d8c132b187d9dfefe0f409c4fb39b54a6645675:

Delayed settings.DATABASES usage by ConnectionHandler

Refs #20474.

comment:4 Changed 2 years ago by Claude Paroz <claude@…>

In 6a6bb168be90594a18ab6d62c994889b7e745055:

Delayed settings.DATABASE_ROUTERS usage by ConnectionRouter

Refs #20474.

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