Instead of going to views.py, I want it to go to to a template, robots.txt.
Use the class based generic views but register with the django 2.0+ pattern.
from django.urls import path
from django.views.generic import TemplateView
urlpatterns = [
path('foo/', TemplateView.as_view(template_name='foo.html'))
]
https://docs.djangoproject.com/en/2.0/ref/class-based-views/base/#templateview
Use the class based generic views.
from django.views.generic import TemplateView
urlpatterns = patterns('',
(r'^foo/$', TemplateView.as_view(template_name='foo.html')),
)
urlpatterns = patterns('django.views.generic.simple',
(r'^foo/$', 'direct_to_template', {'template': 'foo_index.html'}),
(r'^foo/(?P<id>\d+)/$', 'direct_to_template', {'template': 'foo_detail.html'}),
)