有人可以解释并纠正我删除条目的问题吗?
url(r'^remove/(?P<id>\d+)/$', 'registration.views.removerequest'),
<a href = '/remove/{{ object.id }}/'>remove</a>
#view
def removerequest(request,id):
if not request.user.is_authenticated():
get_objects=Todos.objects.get(pk=id)
return HttpResponseRedirect('/remove/')
if request.method =='POST':
delete= get_objects.delete()
return HttpResponseRedirect('/profile/')
context = {'delete':delete}
return render_to_response('remove.html',context,context_instance=RequestContext(request))