class AccountDeleteView(DeleteView):
model = User
success_url = reverse_lazy('accountapp:login')
template_name = 'accountapp/delete.html'
Python
복사
views.py
<a href="{% url 'accountapp:delete' pk=user.pk%}">
<p>
Quit
</p>
</a>
Python
복사
{% extends 'base.html' %}
{% load bootstrap4 %}
{% block content %}
<div style = "text-align: center; max-width: 600px; margin: 4rem auto">
<div class="mb-4">
<h4>Quit</h4>
</div>
<form action="{% url 'accountapp:delete' pk=user.pk%}" method="post">
{% csrf_token %}
{% bootstrap_form form %}
<input type="submit" class="btn btn-danger rounded-pill col-6 mt-3">
</form>
</div>
{% endblock %}
Python
복사