Dee*_*eyi 0 python django post http-status-code-405 django-class-based-views
所以这是我写的一个简单的观点.
class PostTestView(View):
def post(self, request, *args, **kwargs):
print request.POST
return HttpResponse("Hello there")
Run Code Online (Sandbox Code Playgroud)
我urls.py对以上观点有这一行:
url(r'^test/create$',PostTestView.as_view(), name='app.views.create_test')
Run Code Online (Sandbox Code Playgroud)
但是405 Http error当我试图击中时,我得到了一个http://127.0.0.1:8000/app/test/create
这显然意味着我的方法post不在定义的方法列表中.但我在我看来已将其定义如上.这可能有什么问题?我很无能为力
| 归档时间: |
|
| 查看次数: |
678 次 |
| 最近记录: |