方法一:(The best way)
urlpatterns = patterns(
(r’^robots.txt$’, TemplateView.as_view(template_name=’robots.txt’, content_type=’text/plain’)),
)
其他:
http://stackoverflow.com/questions/6867468/setting-up-mimetype-when-using-templateview-in-django
方法一:(The best way)
urlpatterns = patterns(
(r’^robots.txt$’, TemplateView.as_view(template_name=’robots.txt’, content_type=’text/plain’)),
)
其他:
http://stackoverflow.com/questions/6867468/setting-up-mimetype-when-using-templateview-in-django