Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gfhuseyinyilmaz opened this issue Dec 16, 2017 · 1 comment
Open

Comments

@gfhuseyinyilmaz
Copy link

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()

@ogonkov
Copy link

ogonkov commented Jun 6, 2018

Why not set ROBOTS_SITE_BY_REQUEST?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants