سؤال

[
  {
    "model": "django.contrib.Site",
    "pk": 1,
    "fields": {
      "domain_name": "en.localhost",
      "display_name": "EN site"
    }
  }]

I've made an app and put the fixture above in a directory name 'fixtures'. When I run python manage.py loaddata migrate/fixtures/sites_config.json, I get the error:

Problem installing fixture 'migrate/fixtures/sites_config.json': Invalid model identifier: 'django.contrib.Site'

  • How do I reference the sites model in the fixture?
  • Is this a sane strategy for configuring site in code (so i don't have to manually add sites in admin)
  • Should I use the this strategy for managing a migration of content to a django site. Ie, I create fixtures containing content for each content type and then I migrate them in before going live?
هل كانت مفيدة؟

المحلول

It's sites.Site,

For the migration I went the way of fixtures and can't see any problems...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top