0

我在尝试配置我的管理员 grappelli 时遇到错误。每当我的索引被注释掉时,管理页面都可以正常工作。但是当取消注释时,它会给我一个错误,在 /admin/ 处配置不当。那我应该如何配置管理员呢?

from django.conf.urls.defaults import *
from django.views.static import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'^admin/', include('apps.grappelli.urls')),
    (r'^admin/', include(admin.site.urls)),
    (r'^$', include('apps.index.views')),

    # Examples:
    #(r'^blog/', include('apps.blog.views')),

    # Uncomment the admin/doc line below to enable admin documentation:
    #(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:

)

谢谢。

4

1 回答 1

1

这是我的urlconf,我也在使用 grampelli 并且工作正常,

urlpatterns = patterns('',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^grappelli/', include('grappelli.urls')),

我建议你使用django-boilerplate来摆脱这个小配置问题。

于 2013-02-02T20:33:19.610 回答