Site matching query does not exist

前端 未结 7 1378
小蘑菇
小蘑菇 2020-11-27 13:27

Python noob, as in this is my first project, so excuse my unfamiliarity.

The site was working very well until I clicked \"log out\" on my app. After that, the websit

相关标签:
7条回答
  • 2020-11-27 14:06

    If you don't have a site defined in your database and django wants to reference it, you will need to create one.

    From a python manage.py shell :

    from django.contrib.sites.models import Site
    new_site = Site.objects.create(domain='foo.com', name='foo.com')
    print (new_site.id)
    

    Now set that site ID in your settings.py to SITE_ID

    0 讨论(0)
提交回复
热议问题