博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Django ViewDoesNotExist error
阅读量:5309 次
发布时间:2019-06-14

本文共 1689 字,大约阅读时间需要 5 分钟。

版本问题

引文:

 

I'm using Django 1.5.1. Everything was OK. But as soon as I installed django-photologue through pip I face this error when I visit admin url:

>**ViewDoesNotExist at /admin/**  Could not import django.views.generic.list_detail.object_list. Parent module django.views.generic.list_detail does not exist.  Request Method: GET  Request URL:    http://localhost:8000/admin/  Django Version: 1.5.1  Exception Type: ViewDoesNotExist  Exception Value:      Could not import django.views.generic.list_detail.object_list. Parent module   django.views.generic.list_detail does not exist.  Exception Location: /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in get_callable, line 104  Python Executable:  /usr/bin/python  Python Version: 2.7.3

Also when I run syncdb, photologue sync with database without any error and I can import it in shell.

Any idea about how can I solve this error?

   

2 Answers

1
accepted

django-photologue was most likely built for an older version of Django. Looks like the newer version of Django isn't friendly with generic views and prefers class based views instead.

Downloading a fresh copy of Django 1.5.1 shows the following:

Whereas Django 1.4.2 shows:

Simply put, the newer version of Django removed the list_detail file.

   
 
2

to replace the file in the directory urls.py photologue :

"django.views.generic.date_based"and"django.views.generic.list_detail" on "django.views.generic" "object_list" on "list.ListView" "object_detail" on "detail.DetailView" "archive_year" on "dates.YearArchiveView" "archive_month" on "dates.MonthArchiveView" "archive_day" on "dates.DayArchiveView"

like this :)

转载于:https://www.cnblogs.com/michaely/p/3337738.html

你可能感兴趣的文章
rtmp服务器以及rtmp推流/拉流/转发
查看>>
面向对象设计中private,public,protected的访问控制原则及静态代码块的初始化顺序...
查看>>
挑战常规--不要这样使用异常
查看>>
malloc函数的用法
查看>>
渐变的参数
查看>>
C#委托详解(3):委托的实现方式大全(续)
查看>>
RaceWeb终于可以在oracle中快速建表了
查看>>
新一代记事本“Notepad++”个性化设置备份
查看>>
Docker
查看>>
shell 变量和参数
查看>>
awk
查看>>
shell 输入和输出
查看>>
LVS负载均衡
查看>>
Tomcat假死
查看>>
tomcat 性能优化
查看>>
mysql数据库 高可用集群
查看>>
NGINX服务器
查看>>
ELK日志系统
查看>>
Redis
查看>>
LOCK TABLES和UNLOCK TABLES
查看>>