Django -构建网站结构分析
2019-02-15 本文已影响0人
YI_YI_
目录结构分析

创建View
1.使用HttpResponse的方式返回信息
(1):创建文件view.py
from django.http import HttpResponse
def hello(request):
return HttpResponse("Hello World!")
(2):配置路径urls.py,引入view
from django.conf.urls import url
from . import view
urlpatterns = [
url(r'^$',view.hello)
]
(3)结果:

目录结构
