Add user signup form and implement signup view; enhance message display in templates
This commit is contained in:
parent
6ab5748cbc
commit
700ab7ecca
8 changed files with 66 additions and 2 deletions
|
@ -1,5 +1,17 @@
|
|||
from django.contrib.auth.models import User
|
||||
from django.contrib.messages.views import SuccessMessageMixin
|
||||
from django.views.generic.base import TemplateView
|
||||
from django.views.generic.edit import CreateView
|
||||
|
||||
from . import forms
|
||||
|
||||
|
||||
class HomePageView(TemplateView):
|
||||
template_name = "index.html"
|
||||
|
||||
|
||||
class SignupView(SuccessMessageMixin, CreateView):
|
||||
model = User
|
||||
form_class = forms.UserSignupForm
|
||||
success_url = "/"
|
||||
success_message = "Le compte %(username)s a été créé avec succès."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue