栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

第七课(补充) 商城shopper

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

第七课(补充) 商城shopper

商城shopper
  • (一)、更改templates的内容
    • 1.更改login.html
  • (三)、设置子路由urls.py
    • 因为总路由urls.py后面有加斜杠所以子路由不需要加斜杠
  • (四)、效果图展示
    • 1.shopper页面
    • 2.login页面
    • 3.logout页面
    • 4.shopcart页面

(一)、更改templates的内容

分别更改login.html、shopcart.html、shopper.html

1.更改login.html

{% load static %}

login login页面 ![在这里插入图片描述](https://img-blog.csdnimg.cn/aad131edd6cf465f840146c9ab60f925.png) ## 2.更改shopper.html {% load static %} shopper shopper页面 ![在这里插入图片描述](https://img-blog.csdnimg.cn/63d582aa037940e1bb84e7b9861494fe.png) ## 3.更改shopcart.html {% load static %} shopcart shopcart页面 ![在这里插入图片描述](https://img-blog.csdnimg.cn/02123cf4ca084df48bce71451adf0ab4.png) # (二)、更改shopper下view视图 def shopperView(request): return render(request,'shopper.html')

def loginView(request):
return render(request,‘login.html’)

def shopcartView(request):
return render(request,‘shopcart.html’)

def logoutView(request):
return HttpResponse(‘成功退出网站~’)

(三)、设置子路由urls.py 因为总路由urls.py后面有加斜杠所以子路由不需要加斜杠

urlpatterns = [
path(‘.html’, shopperView, name=‘shopper’),
path(‘login.html’, loginView, name=‘login’),
path(‘logout.html’, logoutView, name=‘logout’),
path(‘shopcart.html’, shopcartView, name=‘shopcart’)
]


(四)、效果图展示 1.shopper页面

2.login页面

3.logout页面

4.shopcart页面

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/926318.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号