最赞回答 / 董小明
                                
                                                            请认真查看url、path指定路径的不同
                             url(r'^blog/', include('blog.urls'))    之前版本写法 path('blog/', include('blog.urls'))     现在版本写法
                        
                        2019-01-11
                
            
                                最赞回答 / starch
                                
                            
                                                            path('',views.index)是django 2.x版本的推荐用法,这是路由模式;视频中的url(r'^$',views.index)是django 1.x的用法,这是正则表达式模式;
                        
                        2019-01-11
                
            
                                最赞回答 / 水饴
                                
                                                            正则那儿也可以
                            from django.urls import include, path, re_path
re_path(r'^/article/(?P<article_id>[0-9]+)/$',views.article_page,name='article_page')
                        
                        2019-01-08
                
            
                                最赞回答 / 奶思奈斯
                                
                                                            直接导入JsonResponse,通过它就能将数据返回成JSON格式,from django.http import JsonResponse,用法:return JsonResponse(data)
                            
                        
                        2019-01-04
                
            
                                最新回答 / 陆烨昕
                                
                                                            报错显示是没有找到数据表 main.auth_user__old这是应该是自带的数据表试试重新迁移一下整个项目的数据库python manage.py makemigrationspython manage.py migrate然后重启服务器
                            
                        
                        2019-01-03