Getting Site Matching Query Does Not Exist Error after creating django admin

后端 未结 12 2129
后悔当初
后悔当初 2020-12-07 15:05

I\'m going through the standard Django tutorial to create an admin for an app. After commenting the admin related stuff in settings and running syncdb I\'m getting this mess

12条回答
  •  感动是毒
    2020-12-07 15:10

    You could also consider of using fixture feature of django to populate the data automatically: https://docs.djangoproject.com/en/dev/howto/initial-data/

    [
        {
            "model" : "sites.site",
            "pk" : 1,
            "fields": {
                "name"  : "example.com",
                "domain" : "127.0.0.1:8010"
            }
        }
    ]
    

提交回复
热议问题