#15346 closed (worksforme)
SITE_ID default value is wrong
Reported by: | Marco De Paoli | Owned by: | nobody |
---|---|---|---|
Component: | Contrib apps | Version: | 1.2 |
Severity: | Keywords: | SITE_ID | |
Cc: | depaolim@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
after upgrade to django 1.2.5
How to reproduce the problem:
django-admin.py startproject testdjango cd testdjango python manage.py startapp testapp # edit settings for db connection parameters: use ORACLE python manage.py test
Output:
DoesNotExist: Site matching query does not exist.
(If you obtain:
AttributeError: 'module' object has no attribute 'handler500'
you can follow #15343)
Workaround: edit settings.py and set
SITE_ID = 2
Change History (5)
comment:1 by , 14 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 14 years ago
I agree with you that the most likely possibility is that Site object has already been created and then removed by the testcase itself (maybe example.com?). I don't suggest to change the default value to 2 (anyway, why 2?!?). I just wanted to signal that after you start a default project, the project doesn't work on Oracle. To make it work you have to manually edit the settings.py and change the SITE_ID value. This is weird and I suspect that changing a parameter which is not cited in any tutorial and doesn't relate in any way with user, could be anti intuitive for a newbye...
Either you've created a second Site object and deleted the first, or you're reusing a database where one Site object has already been created and then removed (the most likely possibility), or Oracle begins all autonumbered ID sequences at 2 instead of 1 (which seems quite unlikely).
In any case the default SITE_ID won't be changed, because in almost all cases the value of 1 is correct. If it isn't correct for your particular case, then change it in your project.