17 lines
438 B
Python
17 lines
438 B
Python
from django.contrib.auth.forms import UserCreationForm
|
|
from django.urls import reverse_lazy
|
|
from django.views import generic
|
|
from django_registration.forms import User
|
|
|
|
|
|
class SignUpForm(UserCreationForm):
|
|
class Meta:
|
|
model = User
|
|
fields = ('username', 'email',)
|
|
|
|
|
|
class SignUpView(generic.CreateView):
|
|
form_class = SignUpForm
|
|
success_url = reverse_lazy('login')
|
|
template_name = 'registration/signup.html'
|