typeidea icon indicating copy to clipboard operation
typeidea copied to clipboard

配置完urls后运行项目如图

Open arthur-wxy opened this issue 5 years ago • 4 comments

Screen Shot 2020-06-30 at 9 31 42 PM Screen Shot 2020-06-30 at 9 31 52 PM Screen Shot 2020-06-30 at 9 31 55 PM

麻烦老师看下

arthur-wxy avatar Jul 01 '20 12:07 arthur-wxy

访问:http://127.0.0.1:8000/tag/1/

MaoningGuan avatar Jul 03 '20 03:07 MaoningGuan

Screen Shot 2020-07-04 at 10 45 22 PM 老师你好 又碰到新问题了,我现在想进admin的页面也是这个首页,url的代码如下: from django.contrib import admin

from django.conf.urls import url from .custom_site import custom_site from blog.views import post_list, post_detail from config.views import links

urlpatterns = [ url(r'$', post_list), url(r'^category/(?P<category_id>\d+)/$', post_list), url(r'^tag/(?P<tag_id>\d+)/$', post_list), url(r'^post/(?P<post_id>\d+).html$', post_detail), url(r'links/$', links), url(r'^super_admin/', admin.site.urls), url(r'^admin/', custom_site.urls), # path('admin/', admin.site.urls), ]

大概是什么原因造成的呢?url这块是按照书本配置的

arthur-wxy avatar Jul 04 '20 15:07 arthur-wxy

我访问127.0.0.1:8000/admin也是跟上图一样的首页,根本没有跳转到后台管理界面

arthur-wxy avatar Jul 04 '20 16:07 arthur-wxy

这个不太可能吧。。有报错信息吗? 可以访问一下:127.0.0.1:8000/super_admin/,如果能够成功转到后台,就是你的custom_site配置出问题了。

MaoningGuan avatar Jul 05 '20 01:07 MaoningGuan