#22482 closed Bug (fixed)
Sites documentation suggest using initial data fixtures which are deprecated in 1.7
Reported by: | scibi | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.7-beta-1 |
Severity: | Normal | Keywords: | sites, migrations |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
Currently django.contrib.sites documentation suggest to use initial data fixtures to setup correct name and domain for the project (https://docs.djangoproject.com/en/dev/ref/contrib/sites/):
django.contrib.sites
registers apost_migrate
signal handler which creates a default site namedexample.com
with the domainexample.com
. This site will also be created after Django creates the test database. To set the correct name and domain for your project, you can use an initial data fixture.
However automatic loading of fixtures has been deprecated in Django 1.7: https://docs.djangoproject.com/en/dev/howto/initial-data/#automatically-loading-initial-data-fixtures
It would be nice if there was a description in the documentation how to setup sites configuration with migrations. I tried achieving this but without success - referring to Site
model from sites
in migration of some app leads to: LookupError: No installed app with label 'sites'
.
Change History (5)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
IMHO it should be possible to initialize sites
automatically while deploying the project. So it would be great to have a way of doing this described in the docs.
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I believe that "initial data fixture" does not map directly to automatically loading of 'initial_data.<format>' fixtures. You can load the fixtures with
python manage.py loaddata <fixturename>
as well as by a custom migration (which does not need any fixture AFAIK).