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

后端 未结 12 2115
后悔当初
后悔当初 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

    Its all due to if you accidentally delete site from django admin site which is by default (example.com). The code mentioned below also raised an Runtime error.

    from django.contrib.sites.models import Site
    

    so simply make an increment in your SITE_ID by 1 For example if by default it is 1 than change it with 2 change from SITE_ID = 1 TO: SITE_ID = 2

提交回复
热议问题