Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16882 closed Cleanup/optimization (fixed)

Clarify in the doc why one should not use 'init_command' after initial database creation

Reported by: julien Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: jefferya@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In [1], the doc says in regards to the 'init_command' DATABASES settting's option, "After your tables have been created, you should remove this option", presumably for performance reasons. These reasons should be clarified.

[1] https://docs.djangoproject.com/en/dev/ref/databases/#creating-your-tables

Change History (5)

comment:1 Changed 3 years ago by aaugustin

  • Triage Stage changed from Unreviewed to Accepted

I think it's for performance reasons too.

Django opens a connection to the database for each request, so keeping this option will add one SQL query per HTTP request, which isn't negligible even if the query is fast.

comment:3 Changed 3 years ago by programmerq

  • Cc jefferya@… added

comment:4 Changed 3 years ago by Tim Graham <timograham@…>

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

In [9974069620b0f0e6ac2f1e9bd64819ae0a0e623b]:

Fixed #16882 - Clarified why one should not use 'init_command' after initial database creation.

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

In [8bea1a7e4eacfe311651eafb506ab1f4e7691feb]:

[1.4.X] Fixed #16882 - Clarified why one should not use 'init_command' after initial database creation.

Backport of 9974069620 from master

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