学习django遇到的一些问题

python版本号:3.10

django版本号:4.2.1

官方文档“编写你的第一个Django应用”

1.学习后台管理时报错,

TypeError at /admin/

'set' object is not reversible
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 4.2.1
Exception Type: TypeError
Exception Value:
'set' object is not reversible
Exception Location: D:\mniconda\lib\site-packages\django\urls\resolvers.py, line 543, in _populate
Raised during: django.contrib.admin.sites.index

解决方法:将应用中urls.py中的路由表的{}改成[]

 

2.子路由突然不生效了,前一天还可以用

 

 暂时还没找到原因,浏览器缓存也已经清理过了,没办法,只能将子路由改成一级路由

 

posted @ 2023-07-18 21:39  wasua  阅读(1)  评论(0编辑  收藏  举报