Hi Umar,
First of all, please write to the mailing list instead of me personally.
That's one of the main points of a mailing list, that other people have
the chance to learn and help.
Now regarding the code you sent me:
On 2018-07-18 19:11, Umar Kambala wrote:
> *accounts/**views.py*
>
> from django.contrib.auth import login as auth_login
>
> from django.contrib.auth.forms import UserCreationForm
>
> from django.shortcuts import render, redirect
>
> def signup(request):
> if request.method == 'POST':
> form = UserCreationForm(request.POST)
>
> if form.is_valid():
> user = form.save()
>
> auth_login(request, user)
> return redirect('home')
>
> else:
>
> form = UserCreationForm()
>
> return render(request, 'signup.html', {'form': form})
>
> This the code
>
I cannot believe this is the actual code you're trying to run. The
indentation is all wrong. It is quite clear why you return "None" from
your signup function. But among other things, there's no form variable
in scope in this code snippet, so the python interpreter would error out
when interpreting this file, so you wouldn't even get the error you
claim to be getting.
I've recommended that you learn some basic Python programming, probably
programming in general and even the basics of using a computer, but it
seems like you haven't listened.
I'm not gonna spend any more time trying to help you and recommend
others to do the same.
Learn some basics and stop wasting other peoples time until you've made
an effort to do that.
I really cannot put this in a nicer way.
Kind regards,
Kasper Laudrup
--
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+unsubscribe@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/92e438a1-6397-ccb6-7889-9613a13a7525%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment