[Dynamic Language] Python Django: You don't have permission to edit anything
时间:2010-09-12 来源:※ABeen※
Python Django 在配置完Admin管理界面后,用super admin登录管理界面显示:"You don't have permission to edit anything"
查文档发现:Above we used admin.autodiscover() to automatically load theINSTALLED_APPS admin.py modules.
很明显Django 用admin.autodiscover()来自动载入INSTALLED_APPS admin.py 模块。
找到urls.py,将 admin.autodiscover()的注释去掉后权限正常了。
1 1 from django.conf.urls.defaults import *
2 2 from mysite.views import *
3 3 # Uncomment the next two lines to enable the admin:
4 4 from django.contrib import admin
5 5 admin.autodiscover()
6 6
7 7 urlpatterns = patterns(
8 8 '',
9 9 ('^$', index),
10 10 ('^hello/$',hello),
11 11 ('^time$', current_datetime),
12 12 ('^test$',test),
13 13 ('^admin/', include(admin.site.urls)),
14 14 )
15 ~6
相关阅读 更多 +