Untitled
unknown
python
3 years ago
598 B
11
Indexable
class RegistrationView(View):
# Страница регистрации
def get(self, request):
if request.method == 'POST':
form = CreationUserForm(request.POST)
if form.is_valid():
form.save()
messages.success(request, 'Congrutilations you\'re user!')
return redirect('news')
else:
messages.error(request, 'Error of registration')
else:
form = CreationUserForm()
return render(request, 'registration/registration.html', {'form': form})Editor is loading...