Last active
December 28, 2015 02:29
-
-
Save derblub/7428659 to your computer and use it in GitHub Desktop.
Quick one-liner to serve a robots.txt file directly from your urls.py in Django.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################## | |
# SERVING robots.txt FILE - should be removed on production and handled by | |
# the webserver directly (no need for django here) | |
url(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