新建views1.py
#coding:utf-8
from django.http import HttpResponse
def index(request):
return HttpResponse("你好")
在urls.py中修改配置
from . import views1
url(r'^$', views1.index, name='index'),
404 (page not found) 视图
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
找不到了
<hr/>
{{request_path}}
</body>
</html>
DEBUG = False
ALLOWED_HOSTS = ['*', ]
http://127.0.0.1:8000/test/
500 (server error) 视图
400 (bad request) 视图