add signup view
This commit is contained in:
parent
1c85c034b3
commit
04e87711c2
16
Serwer_django/config/views.py
Normal file
16
Serwer_django/config/views.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
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'
|
Loading…
Reference in New Issue
Block a user