Function-based generic views have been deprecated

前提是你 提交于 2019-12-11 03:07:37

问题


DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.

I keep getting this warning, when I'm running my site. What does this mean and how can I fix it?


回答1:


Django 1.3 introduced class-based views and also added a range of generic class-based views. Django also has documentation about migrating function-based views to class-based views.

There is not really much more to say about it: your project currently uses function-based views whereas class-based views are the new way of creating views.



来源:https://stackoverflow.com/questions/12204775/function-based-generic-views-have-been-deprecated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!