#23945 closed New feature (fixed)
Use configured SITE_ID when creating the default site
Reported by: | Wojtek Ruszczewski | Owned by: | nobody |
---|---|---|---|
Component: | contrib.sites | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Consider the following steps:
- start a new project;
- edit settings adding
SITE_ID = 26
and'django.contrib.sites'
; - migrate.
The default "example.com" site will be created with the primary key equal to 1 not 26.
Fixing it in general doesn't seem to cause any harm, but it probably only matters with some nonrel backends. For instance, in MongoDB automatic primary keys are certain bytestings 1 and mongo backend doesn't support anything else as keys.
[1] Supporting such keys requires some black magic, but that's another story.
Note:
See TracTickets
for help on using tickets.
In bfc75996f9b7486929f0c4340bca54a8afa7ecfb: