Skip to content

Instantly share code, notes, and snippets.

@samakshjain
Last active February 27, 2017 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samakshjain/7fb09cff58affd4c30b4c2371ddd6bbd to your computer and use it in GitHub Desktop.
Save samakshjain/7fb09cff58affd4c30b4c2371ddd6bbd to your computer and use it in GitHub Desktop.
One line robots.txt in django
from django.conf.urls import url
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