add robots.txt

This commit is contained in:
William Zhang 2018-05-08 21:27:35 -04:00
parent 5b33ef03cc
commit 97c1c8f89c
2 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ Including another URLconf
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.views.generic.simple import direct_to_template
from django.contrib import admin
from .apps.main import urls as main
import requests
@ -28,5 +29,6 @@ with open("forms.json", 'w') as f:
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include(main))
url(r'^', include(main)),
url(r'^robots\.txt$', direct_to_template, {'template': 'robots.txt', 'mimetype': 'text/plain'})
]