robots 介绍
https://blog.csdn.net/fanghua_vip/article/details/79535639
在线生成链接
http://tool.chinaz.com/robots/
本站 robots.txt
代码语言:javascript复制User-agent: *
Disallow:
Crawl-delay: 5
Disallow: /bin/
Disallow: /photos
Sitemap: http://xieboke.net/sitemap.xml
view
代码语言:javascript复制def robots(request):
with open("joyoo/robots.txt", "r") as f:
content = "<pre>"
for text in f.readlines():
content = text
content = "</pre>"
return HttpResponse(content)
urls
代码语言:javascript复制urlpatterns = [
url(r'^robots', robots),
]