Skip to content

Commit 5b66f3b

Browse files
author
yangxg
committed
添加 robots 规则
1 parent ee9bc6d commit 5b66f3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

blogproject/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
"""
1616
from django.conf.urls import url, include
1717
from django.contrib import admin
18+
from django.http import HttpResponse
1819

1920
urlpatterns = [
2021
url(r'^admin/', admin.site.urls),
2122
url(r'', include('blog.urls')),
2223
url(r'', include('comments.urls')),
24+
url(r'^robots\.txt$', lambda r: HttpResponse('User-agent: *\nDisallow: /', content_type='text/plain')),
2325
]

0 commit comments

Comments
 (0)