Skip to content

Instantly share code, notes, and snippets.

@svfat
Created September 22, 2014 11:59
Show Gist options
  • Save svfat/5c6841182850af63cd03 to your computer and use it in GitHub Desktop.
Save svfat/5c6841182850af63cd03 to your computer and use it in GitHub Desktop.
Django robots.txt "disallow all bots"
from django.http import HttpResponse
urlpatterns = patterns('',
...
(r'^robots\.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", mimetype="text/plain"))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment