from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
from django.contrib import messages
from .models import Profile
from quiz.models import Question


def register(request):
    if request.method == 'POST':
        form = UserRegisterForm(request.POST)
        if form.is_valid():
            form.save()
            username = form.cleaned_data.get('username')
            messages.success(request, f'Account Created for {username}!')
            return redirect('quiz:quiz-index')

    else:
        form = UserRegisterForm()
    return render(request, 'users/register.html', {'form': form})


On Mon, Jan 14, 2019 at 11:39 PM Alex Kimeu <kimeuale...@gmail.com> wrote:

> *views.py*
>
>
> On Mon, Jan 14, 2019 at 11:36 PM Nebojsa Hajdukovic <
> nebojsa.zero...@gmail.com> wrote:
>
>> can you show your views.py?
>>
>> пон, 14. јан 2019. у 19:52 kimeualexis <kimeuale...@gmail.com> је
>> написао/ла:
>>
>>> Hello, guys.
>>>
>>> Anyone with an idea how to hide help texts in Django User Registration
>>> Form?
>>>
>>> Regards.
>>>
>>> [image: Screenshot from 2019-01-14 21-48-53.png]
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/331219f5-b547-456c-a7c4-759c0574d82b%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/331219f5-b547-456c-a7c4-759c0574d82b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJ60hW2T%3DVnYyXGwhaFS-SyK5kg7Voi7at9N-c%2BTiGkpJ4EMVg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAJ60hW2T%3DVnYyXGwhaFS-SyK5kg7Voi7at9N-c%2BTiGkpJ4EMVg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
>
> *"It's when nothing happens that anything can happen."*
> *https://kodenaut.github.io/ <https://kodenaut.github.io/>**+
> <https://kodenaut.github.io/>254 723494571*
>
>

-- 


*"It's when nothing happens that anything can happen."*
*https://kodenaut.github.io/ <https://kodenaut.github.io/>**+
<https://kodenaut.github.io/>254 723494571*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACYP3VHKKKFquA081tDpBmcBfA3N9Ko%2BwtAKxYKwcHHpsC3MHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to