Hello Guys,
Im new to learning web development and django framework. so now im learnig about django’s built in authentication system…
So actually this is my views.py:
def authView(request):
if request.method == "POST":
form =UserCreationForm(request.POST or None)
if form.is_valid():
form.save()
return redirect('login')
else:
form = UserCreationForm()
return render(request, 'registration/signup.html', {"form": form})
This is my urls.py:
from django.urls import path, include
from .views import *
urlpatterns = [
path("accounts/", include("django.contrib.auth.urls")),
path("signup/", authView, name="authView"),
path('', home, name='home'),
]
So while im trying to logout, i got GET method not allowed .
Method Not Allowed (GET): /accounts/logout/
Method Not Allowed: /accounts/logout/
[17/Jan/2025 14:03:42] "GET /accounts/logout/ HTTP/1.1" 405 0
So my doubt is my views is correct or not? or
Is i want to write a logout view? or something else what is my mistake…?