63번째 줄: |
63번째 줄: |
| path('OAuth2.0/detail/<int:pk>', views.OAuth_client_edit, name='OAuth_client_edit'), | | path('OAuth2.0/detail/<int:pk>', views.OAuth_client_edit, name='OAuth_client_edit'), |
| path('OAuth2.0/register', views.OAuth_register_client, name='OAuth_register_client'), | | path('OAuth2.0/register', views.OAuth_register_client, name='OAuth_register_client'), |
| + | path('OAuth2.0/delete/<int:pk>', views.OAuth_delete_client, name='OAuth_delete_client'), |
| </syntaxhighlight> | | </syntaxhighlight> |
| |예시. 각 사정에 맞게 설정. | | |예시. 각 사정에 맞게 설정. |
105번째 줄: |
106번째 줄: |
| else: | | else: |
| form = ClientRegisterForm() | | form = ClientRegisterForm() |
| + | return render(request, 'custom_account/OAuth2/register.html', {'form': form}) |
| + | @login_required |
| + | def OAuth_delete_client(request, pk): |
| + | '''어플리케이션 등록.''' |
| + | app = get_object_or_404(Application, pk=pk, user=request.user) |
| + | if app.user == request.user: |
| + | app.delete() |
| + | return redirect('custom_account:OAuth_client_list') |
| return render(request, 'custom_account/OAuth2/register.html', {'form': form}) | | return render(request, 'custom_account/OAuth2/register.html', {'form': form}) |
| </syntaxhighlight> | | </syntaxhighlight> |
122번째 줄: |
131번째 줄: |
| <div class="card-body"> | | <div class="card-body"> |
| <h5 class="card-title d-flex justify-content-between align-items-center"> | | <h5 class="card-title d-flex justify-content-between align-items-center"> |
− | {{ app.name }}<a class="btn btn-outline-primary btn-sm" href="{% url 'custom_account:OAuth_client_edit' app.pk %}">정보 수정</a></h5> | + | {{ app.name }} |
| + | <span> |
| + | <a class="btn btn-outline-primary btn-sm" href="{% url 'custom_account:OAuth_client_edit' app.pk %}">정보 수정</a> |
| + | <a class="btn btn-outline-danger btn-sm" href="{% url 'custom_account:OAuth_delete_client' app.pk %}" |
| + | onclick="return confirm('정말로 삭제하시겠습니까? 되돌릴 수 없습니다.');">삭제</a> |
| + | </span> |
| + | </h5> |
| <p><strong>Client ID:</strong> {{ app.client_id }}</p> | | <p><strong>Client ID:</strong> {{ app.client_id }}</p> |
| <p><strong>Client Secret:</strong> {{ app.client_secret }}</p> | | <p><strong>Client Secret:</strong> {{ app.client_secret }}</p> |