From 5eb1972c417e351730cd7ff641e27d8635174d2a Mon Sep 17 00:00:00 2001 From: ahosking Date: Thu, 1 Jun 2023 18:45:24 -0400 Subject: [PATCH] Add Accounts App --- api/accounts/urls.py | 9 +++++++++ api/accounts/views.py | 11 +++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 api/accounts/urls.py diff --git a/api/accounts/urls.py b/api/accounts/urls.py new file mode 100644 index 0000000..a10de07 --- /dev/null +++ b/api/accounts/urls.py @@ -0,0 +1,9 @@ +# accounts/urls.py +from django.urls import path + +from .views import SignUpView + + +urlpatterns = [ + path("signup/", SignUpView.as_view(), name="signup"), +] diff --git a/api/accounts/views.py b/api/accounts/views.py index 91ea44a..bba0735 100644 --- a/api/accounts/views.py +++ b/api/accounts/views.py @@ -1,3 +1,10 @@ -from django.shortcuts import render +# accounts/views.py +from django.contrib.auth.forms import UserCreationForm +from django.urls import reverse_lazy +from django.views import generic -# Create your views here. + +class SignUpView(generic.CreateView): + form_class = UserCreationForm + success_url = reverse_lazy("login") + template_name = "registration/signup.html"