Opened 11 years ago
Closed 11 years ago
#20896 closed Uncategorized (worksforme)
Missing a step in "Activate the admin site"
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | Admin, DoesNotExist |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
If you use Django 1.4.5 and follow the steps on https://docs.djangoproject.com/en/1.4/intro/tutorial02/ to "Activate the admin site" you'll get a "DoesNotExist at /admin/" error page.
With a new installation, the django_site table is empty. It needs at least one record or the admin site will fail with the "DoesNotExist at /admin/" error page. To fix the problem:
python manage.py shell
from django.contrib.sites.models import Site
Site.objects.create(pk=1, domain='YourDomainName', name='YourName')
Please update the https://docs.djangoproject.com/en/1.4/intro/tutorial02/ with this info.
An entry for "example.com" should be created automatically when you run
syncdb
. You may have made a mistake following the instructions.