【发布时间】:2013-09-29 07:32:12
【问题描述】:
所以这是我写的一个简单的视图。
class PostTestView(View):
def post(self, request, *args, **kwargs):
print request.POST
return HttpResponse("Hello there")
我的urls.py 在上面的视图中有这一行:
url(r'^test/create$',PostTestView.as_view(), name='app.views.create_test')
但是当我尝试点击 http://127.0.0.1:8000/app/test/create 时,我得到一个 405 Http error
这显然意味着我的方法post 不在定义的方法列表中。但在我看来,我已经将其定义为如上。
这里可能有什么问题?我一无所知
【问题讨论】:
标签: python django post django-class-based-views http-status-code-405