标签:设计 修改 pat com 路径 管理 结束 render oam
from django.conf.urls import url
from django.conf.urls import include #导入include,用于二级路由
import xadmin
urlpatterns = [
# path('admin/', admin.site.urls),
url('xadmin/',xadmin.site.urls),
url(r'',include('app_login.urls')), #这里指向二级路由app下的urls.py文件
]
from django.conf.urls import url
from app_login import views
urlpatterns=[
url(r'^login/index/',views.index),
url(r'^login/login/',views.login),
url(r'^login/register/',views.register),
def index(request):
return render(request,'login/index.html')
def login(request):
return render(request,'login/login.html')
def register(request):
return render(request,'login/register.html')
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>主页</title>
</head>
<body>
<h1>主页</h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登陆页面</title>
</head>
<body>
<h1>登陆页面</h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>注册页面</title>
</head>
<body>
<h1>注册页面</h1>
</body>
</html>
由于之前安装的xadmin表创建在了sqlite上,更换mysql后,重新创建了表,需要重新创建超级管理员账号密码
到这里就准备工作就结束了,后面的主要操作就是html页面和视图了
标签:设计 修改 pat com 路径 管理 结束 render oam
原文地址:https://www.cnblogs.com/endmoon/p/9744733.html