【发布时间】:2018-02-04 21:23:33
【问题描述】:
我正在开发一个 Django 应用程序,并在我的 urls.py 中定义了以下行
path('organizations/', views.OrganizationListView().as_view(), name='organizations'),
当我运行我的服务器时,我收到以下错误
lib\site-packages\django\utils\decorators.py", line 11, in __get__
raise AttributeError("This method is available only on the class, not on instances.")
AttributeError: This method is available only on the class, not on instances.
我知道这一定是因为在对象和类上调用方法的不同,但不确定究竟是什么导致了它以及如何解决。
【问题讨论】: