Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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 a post_migrate signal handler which creates a default site named example.com with the domain example.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 Tim Graham, 10 years ago

Triage Stage: UnreviewedAccepted

comment:2 by rtnpro, 10 years ago

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).

comment:3 by scibi, 10 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 Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In bbf0a9545bd098f09aeb0c2fb63497eb0ddf13ad:

Fixed #22482 -- Recommended using data migrations in contrib.sites docs.

Thanks scibi for the report.

comment:5 by Tim Graham <timograham@…>, 10 years ago

In 8c7d2edd45cc1f1a9c5146e3be9716fbcfcbc826:

[1.7.x] Fixed #22482 -- Recommended using data migrations in contrib.sites docs.

Thanks scibi for the report.

Backport of bbf0a9545b from master

Note: See TracTickets for help on using tickets.
Back to Top