Code

Opened 3 years ago

Closed 22 months ago

Last modified 22 months 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

Attachments (0)

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 2 years ago by programmerq

  • Cc jefferya@… added

comment:4 Changed 22 months 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 22 months 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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.