django のviewの追加のしかたメモ
project の作成
django-admin.py startproject hogehoge
templateの設定
vim hogehoge/settings.py
TEMPLATE_DIRS = ( 'templates/mytemplates', )
絶対パスでかくこと
appの作成
python manage.py startapp hogeapp
urlの設定
vim hogehoge/urls.py
=> url(r'^hogeapp/$', 'hogeapp.views.index'),
のように追加
templatesの追加
touch mytemplates/hogeapp/index.html
viewsの編集
vim hogeapp/views.py
""" ang """ from django.shortcuts import render_to_response def index(request): """ ang """ return render_to_response('ang/index.html')