Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#24488 closed Bug (fixed)

Optional SITE_ID when migrating django.contrib.sites

Reported by: Claudemiro Owned by: Marten Kenbeek
Component: contrib.sites Version: 1.8beta2
Severity: Release blocker Keywords: sites, SITE_ID, database
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation says:

"get_current_site() will now lookup the current site based on request.get_host() if the SITE_ID setting is not defined."

https://docs.djangoproject.com/en/dev/releases/1.8/#django-contrib-sites

When I try to migrate the project without the SITE_ID parameter, then I got this error:

AttributeError: 'Settings' object has no attribute 'SITE_ID'

I know about the ticket https://code.djangoproject.com/ticket/23945

I think a better approach is to use the SITE_ID for the migration only if the SITE_ID is configured in settings file, otherwise it must be auto incremented as it were before.

Change History (5)

comment:1 by Marten Kenbeek, 9 years ago

Owner: changed from nobody to Marten Kenbeek
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham, 9 years ago

Severity: NormalRelease blocker
Triage Stage: AcceptedReady for checkin

comment:4 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 818182b:

Fixed #24488 -- Made create_default_site() use default pk of 1.

Fixed create_default_site() to use a default value in case
settings.SITE_ID isn't set; refs #23945.

comment:5 by Tim Graham <timograham@…>, 9 years ago

In febcbbf:

[1.8.x] Fixed #24488 -- Made create_default_site() use default pk of 1.

Fixed create_default_site() to use a default value in case
settings.SITE_ID isn't set; refs #23945.

Backport of 818182b514d1c6b379130c440689355b4d231d49 from master

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