the5fire / typeidea

Django企业开发实战对应项目代码
http://django-practice-book.com/
Other
439 stars 214 forks source link

配置完urls后运行项目如图 #50

Open arthur-wxy opened 4 years ago

arthur-wxy commented 4 years ago
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

麻烦老师看下

MaoningGuan commented 4 years ago

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

arthur-wxy commented 4 years ago
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\d+)/$', post_list), url(r'^tag/(?P\d+)/$', post_list), url(r'^post/(?P\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 commented 4 years ago

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

MaoningGuan commented 4 years ago

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