Skip to content

django-robots without SITE_ID set gives an error on django 2.0 #88

@gfhuseyinyilmaz

Description

@gfhuseyinyilmaz

To repeat this.

  1. Make sure django goversion is 2.X or above
  2. Make sure SITE_ID is not set.
  3. Make sure ROBOTS_SITE_BY_REQUEST is not set on settings.

/robots.txt endpoint gives following error:

You're using the Django "sites framework" without having set the SITE_ID setting. Create a site in your database and set the SITE_ID setting or pass a request to Site.objects.get_current() to fix this error.

It would be nice if SITE_ID is not set django's default behaviour would work.
Error is coming from this line:

return Site.objects.get_current()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions