Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arthur-wxy opened this issue Jul 1, 2020 · 4 comments
Open

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

arthur-wxy opened this issue Jul 1, 2020 · 4 comments

Comments

@arthur-wxy
Copy link

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
Copy link

MaoningGuan commented Jul 3, 2020

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

@arthur-wxy
Copy link
Author

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
Copy link
Author

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

@MaoningGuan
Copy link

MaoningGuan commented Jul 5, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants