Python Django 编写一个简易的后台管理工具3-运行项目

编写view页面

def hello(request):
    return render(request,'hello.html')

编写html页面

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>hi</title>
</head>
<body>
<p>hello</p>
</body>
</html>

编写路由

from django.conf.urls import url
from django.contrib import admin
from hello.views import *

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^hello/', hello),
]

页面展示

posted @ 2019-08-22 17:37  小明tx  阅读(376)  评论(0编辑  收藏  举报