Skip to content

Instantly share code, notes, and snippets.

@svfat
Created July 15, 2015 08:47
Show Gist options
  • Save svfat/c3ca5169f838b3fd9b72 to your computer and use it in GitHub Desktop.
Save svfat/c3ca5169f838b3fd9b72 to your computer and use it in GitHub Desktop.
django robots.txt in urls
from django.http import HttpResponse
urlpatterns += url(r'^robots.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", content_type="text/plain"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment