Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #####HTML###########
- <a href="delete/{{comp.id}}"> <span class="fa fa-trash-o"></span><a>
- #######################################################################
- #################views.py##############################################
- def delete_comp(request, id):
- try:
- competition = Competition.objects.get(id=id)
- competition.delete()
- return redirect('start/')
- except Person.DoesNotExist:
- return HttpResponseNotFound("<h2>Competition not found</h2>")
- ######################################################################
- #################urls.py##############################################
- path('deletecomp/<int:id>/', delete_comp),
- ######################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement