Django 访问admin提示ViewDoesNotExist at /admin/

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

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

最终截图

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容