RandomSec/Serwer_django/config/views.py

17 lines
438 B
Python
Raw Normal View History

2022-01-23 22:32:35 +01:00
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'