Code

Ticket #7514: 7514.diff

File 7514.diff, 524 bytes (added by telenieko, 6 years ago)

Clear SITE_CACHE on syncdb.

Line 
1diff --git a/django/contrib/sites/management.py b/django/contrib/sites/management.py
2index 6831cab..5cecfb4 100644
3--- a/django/contrib/sites/management.py
4+++ b/django/contrib/sites/management.py
5@@ -13,5 +13,6 @@ def create_default_site(app, created_models, verbosity):
6             print "Creating example.com Site object"
7         s = Site(domain="example.com", name="example.com")
8         s.save()
9+    Site.objects.clear_cache()
10 
11 dispatcher.connect(create_default_site, sender=site_app, signal=signals.post_syncdb)