Custom sites model overridden by contrib.sites.model.Site
|Reported by:||briehan.lombaard@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
We have a custom 'sites framework' implementation that basically consists of a Site model and SiteManager. For some reason, when running our application, the Site model from django.contrib.sites is used instead of our own.
I did the following from within the app:
from myapp.sites.models import Site print Site.objects <class 'django.contrib.sites.models.Site'>
When doing the same from the management shell (./manage.py shell), I get the expected output:
>>> from myapp.sites.models import Site >>> type(Site.objects) <class 'foobar.sites.models.Site'>
Our application used to run fine on Django 1.0 and subsequently on 1.1 and 1.2 during my current upgrade attempt to get the application onto version 1.3. I also tried this using the current trunk (revision 16483) and got the same result.
I'm attaching a minimal Django project that replicates this behavior on my machine. You will see that running ./manage syncdb actually creates a 'django_site' table instead of 'sites'.
Change History (19)
Changed 3 years ago by briehan.lombaard@…
comment:1 in reply to: ↑ description Changed 3 years ago by anonymous
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:13 Changed 3 years ago by ramiro
- Resolution set to duplicate
- Status changed from new to closed
comment:15 Changed 3 years ago by lakin
- Resolution duplicate deleted
- Status changed from closed to reopened