• site matching query does not exist. django?

    site matching query does not exist. django Python Freamework

    Silver Member Asked on June 15, 2018 in Python.
    Add Comment
  • 1 Answer(s)
    Best answer

    The Site object for your Django project is missing. Each Django project has a Site object which contains the site’s name and domain. It is usually automatically created when creating a Django project (in particular, when the syncdb command runs) but in your case it seems that didn’t happen.

    To fix it:

    Open the Django shell for your site (python manage.py shell).

    Type the following:

    
    >>> from django.contrib.sites.models import Site
    
    >>> Site.objects.create(name='example.com', domain='example.com')
    
    

    If you want to change these values later, go to your admin panel (/admin/) and edit the site object in the section Sites.

    Silver Member Answered on June 15, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.