#17243: running syncdb alters table django_site (replaces site info with 
"example")
-------------------------------------+-------------------------------------
     Reporter:  nikita.delyukov@…    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.2
  (models, ORM)                      |               Resolution:  needsinfo
     Severity:  Normal               |             Triage Stage:
     Keywords:  syncdb               |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by kmtracey):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => needsinfo
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 I cannot recreate this behavior. The code that creates the "example" site
 is `create_default_site` in django.contrib.sites.management.py. Back in
 1.2 (the version set for this ticket) that code was:
 
https://code.djangoproject.com/browser/django/tags/releases/1.2/django/contrib/sites/management.py#L9.
 It's a signal handler attached to the syncdb signal, but it only creates
 the example site object if the Site table was among those created by this
 syncdb run. Also, even if that 1.2 level code mistakenly ran when the Site
 table already existed and that example site had been customized to have a
 different name & domain, that 1.2 level code would not replace the
 customized instance but rather just add another one (which would have a
 different PK than what is specified as SITE_ID in settings) with the
 "example" name & domain. I think there must be more to the story than what
 has been reported here, because I can neither recreate in trying nor see
 by looking at the code how what has been reported could be happening. Is
 there any way your syncdb is being preceded by something that causes the
 existing Site table to be dropped before the syncdb?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17243#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to