django2.0,python 3.6
都不需要改,直接超链接就可以了
<a href="/blog/article/{{art.id}}">{{art.title}}</a>
都不需要改,直接超链接就可以了
<a href="/blog/article/{{art.id}}">{{art.title}}</a>
2018-01-31
页面跳转错误,观察url,如果两个article,需要重定向
from django.http import HttpResponseRedirect
return HttpResponseRedirect('/blog/index')
from django.http import HttpResponseRedirect
return HttpResponseRedirect('/blog/index')
2018-01-31
path('article/<int:article_id>/', views.article_page),
2.0 用上面 这个通过了
2.0 用上面 这个通过了
2018-01-31
最新回答 / cswuyepeng
pycharm创建项目时导入包出错了,可能是你新建的项目名和你之前创建的或者刚删除的项目名同名,pycharm里还有你之前项目的缓存,我昨天也遇到过,重启电脑(最简单的清缓存的方法了)就好了
2018-01-30
我被坑了一把,我访问index页面一直报错Reverse for 'article_page' with arguments '(1,)' and keyword arguments '{}' not found. 0 pattern(s) ,我把那个name=‘article_page’改成name=‘article_page1’,并且把html页面调用也跟着改成名字加1后就正常了。然后我把名字+1去掉后,还是可以访问,这尼玛逗我玩了。另外一个坑就是,当时的index页面,老师将他放在了blog文件夹下,我当时没建那个文件夹,然后因为路径少了这个blog,访问页面一直报错,这尼玛一吨好找
2018-01-26
最赞回答 / magicianyin
是打开了sqlite expert personal选择不了db.sqlite3这个文件是么?我打开了sqlite expert之后,点击new database,然后在弹出的选择文件弹窗中文件类型选择all,然后在选择db.sqlite3可以导入了
2018-01-25