Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default Site ID to use settings.SITE_ID #14

Open
wants to merge 1 commit into
base: nonrel-1.5
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion django/contrib/sites/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.db.models import signals
from django.db import connections
from django.db import router
from django.conf import settings
from django.contrib.sites.models import Site
from django.contrib.sites import models as site_app
from django.core.management.color import no_style
Expand All @@ -19,7 +20,7 @@ def create_default_site(app, created_models, verbosity, db, **kwargs):
# can also crop up outside of tests - see #15346.
if verbosity >= 2:
print("Creating example.com Site object")
Site(pk=1, domain="example.com", name="example.com").save(using=db)
Site(pk=settings.SITE_ID, domain="example.com", name="example.com").save(using=db)

# We set an explicit pk instead of relying on auto-incrementation,
# so we need to reset the database sequence. See #17415.
Expand Down