美文网首页
Django 访问admin提示ViewDoesNotExist

Django 访问admin提示ViewDoesNotExist

作者: samcao | 来源:发表于2015-06-13 17:08 被阅读0次

    ViewDoesNotExist at /admin/

    Could not import django.views.generic.simple.redirect_to. Parent module django.views.generic.simple does not exist.

    Request Method: 

    GET

    Request URL:

    http://127.0.0.1:8888/admin/

    Django Version:

    1.7.8

    Exception Type:

    ViewDoesNotExist

    Exception Value:

    Could not import django.views.generic.simple.redirect_to. Parent module django.views.generic.simple does not exist.

    Exception Location:

    C:\Python27\lib\site-packages\django-1.7.8-py2.7.egg\django\core\urlresolvers.py in get_callable, line 104

    Python Executable:

    C:\Python27\python.exe

    Python Version:

    2.7.9

    Python Path:

    ['D:\\samcao\\mailclient',
     'C:\\Python27\\lib\\site-packages\\django-1.7.8-py2.7.egg',
     'C:\\Windows\\system32\\python27.zip',
     'C:\\Python27\\DLLs',
     'C:\\Python27\\lib',
     'C:\\Python27\\lib\\plat-win',
     'C:\\Python27\\lib\\lib-tk',
     'C:\\Python27',
     'C:\\Python27\\lib\\site-packages']

    Server time: Sat, 13 Jun 2015 17:06:45 +0800

    最终检查发现是由于urls.py中的url设置有问题:

    urlpatterns = patterns('',
        # Examples:
        # url(r'^$', 'mailclient.views.home', name='home'),
        # url(r'^blog/', include('blog.urls')),

        url(r'^admin/', include(admin.site.urls)),
        url(r'^favicon\.ico$','django.views.generic.simple.redirect_to',{'url':'/static/images/favicon.ico'}),
    )

    上面因为之前配置ICO文件时有配置

    django.views.generic.simple.redirect_to

    测试有误.将其删除掉.恢复正常.

    最终截图

    相关文章

      网友评论

          本文标题:Django 访问admin提示ViewDoesNotExist

          本文链接:https://www.haomeiwen.com/subject/qcgjqttx.html