How to correct this error: “'Adminsite' object has no attribute 'root'”

后端 未结 2 446
迷失自我
迷失自我 2021-02-01 15:56

The full error message is:

AttributeError on running Django app on apache as localhost -- \'Adminsite\' object has no attribute \'root\'

相关标签:
2条回答
  • 2021-02-01 16:42

    Your url for admin should be:
    url(r'^admin/', include(admin.site.urls))
    not (r'^admin/(.*)', admin.site.root)
    - it's for Django 1.0. For Django 1.3 it wouldn't work.

    0 讨论(0)
  • 2021-02-01 16:46

    Another possible issue here, which I encountered, is that admin has not been properly configured in the settings.py file. Anyone having this issue would want to check that their installed apps include django.contrib.admin. Reference https://docs.djangoproject.com/en/1.3/faq/admin/ for details.

    0 讨论(0)
提交回复
热议问题