周末没事在家捣腾Django ,使用的最新版本1.1, 启用'django.contrib.admin'后login到admin显示"You don't have permission to edit anything", 查了下文档
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf,发现admin.autodiscover()这行注释没去掉,再试就可以编辑了。
# urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
('^admin/', include(admin.site.urls)),
)
Above we used admin.autodiscover() to automatically load the INSTALLED_APPS admin.py modules.
ModelAdmin objects
class ModelAdmin
The ModelAdmin class is the representation of a model in the admin interface. These are stored in a file named admin.py in your application. Let’s take a look at a very simple example of the ModelAdmin:
from django.contrib import admin
from myproject.myapp.models import Author
class AuthorAdmin(admin.ModelAdmin):
pass
admin.site.register(Author, AuthorAdmin)
分享到:
相关推荐
Apache You don't have permission to access / on this server是一个在配置Apache时候,常常遇到的问题
主要介绍了apache You don't have permission to access /test.php on this server解决方法,需要的朋友可以参考下
键字: Apache 403 Forbidden 系统配置: 操作系统:Red Hat Linux 6.2 Web服务器:Apache 3.1.1+jakarta-tomcat 3.1.1 数据库服务器:oracle 8i Apache服务器是目前应用... You don’t have permission to access
主要介绍了WampServer设置apache伪静态出现404 not found及You don't have permission to access / on this server解决方法,较为详细的分析了几种常见情况,非常具有实用价值,需要的朋友可以参考下
本文实例讲述了WampServer设置apache伪静态出现404 not found及You don’t have permission to access / on this server解决方法。分享给大家供大家参考。具体如下: 出现404 not found 时: 确保LoadModule rewrite_...
易网主机ShopexEcshop报错Can't createwrite to file解决方案
运行php时提示You don't have permission to access /index.php on.错误的解决方法,需要的朋友可以参考下
ueditor将图片上传至服务器地址的demo,参考资料:http://blog.csdn.net/yufeng005/article/details/79420663
QuartusII 应用文档,找了很久才找到!
Suggest changes to projects you don’t have permission to edit directly Use tools like issues, pull requests, and branches to specify and collaborate on changes Create a new GitHub repository to ...
You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not ...
Forbidden You don't have permission to access / on this server.
经典书籍,中文第二版,学习linux设备驱动的必备参考书
You are welcome to use this plan as a starting point to create your own, but you do not have permission to resell, reproduce, publish, distribute or even c opy this plan as it exists here.
Head on over to their website if you don't already have one. Download Step 1. Add the JitPack repository to your root build.gradle file. allprojects { repositories { ... maven { url '...
凤凰新闻文本第二部分 欢迎大家光临我的博客:http://hi.baidu.com/finallyliuyu 如您在语料库的使用中遇到什么问题,可从以上博客联系我
You do not have permission to view this page
You don’t need to ask permission to use any of the visuals but it will be nice if you can provide credit to the designer/author (author information found in the slide notes). Check out the versions ...
That doesn’t mean you can’t target iOS lower than 10 - you simply have to prepare fallback code to cover cases when user doesn’t have access to speech recognition (SpeechRecognizer.EngineExists() ...
Be careful and be sure you know how to undo anything you might have done. For example, in Windows 98: * open Windows Explorer * View -> Folder Options * select the "File Types" tab * Find and select...