Dondariadmin (トーク | 投稿記録) (ページの作成:「== やりたいこと == * http://example.com/robots.txt アクセスに対してrobos.txtを正しく返す。 == 手順 == === app_dir/urls.py === from django.vie...」) |
(相違点なし)
|
from django.views.generic import TemplateView urlpatterns = [
... url(r'^robots\.txt', TemplateView.as_view(template_name='static/robots.txt', content_type='text/plain')), # <- append
touch template/robots.txtTweet