On Apr 10, 2006, at 10:53 PM, [EMAIL PROTECTED] wrote:
>
> I was wondering if somebody could help me out. i'm trying to write a
> simple form to create users ... however the post data always seems to
> be empty.
>
> And here's the view:
>
> from django.core.template import Context, loader
> from django.utils.httpwrappers import HttpResponse,
> HttpResponseRedirect
>
> from django.models.gms import chapters, Member
> from django.models.auth import users
>
> def createAccount(request):
> """
> Create new account view.
> """
> t = loader.get_template('gms/CreateAccount')
> errors = request
> if request.POST:
> data = request.POST
> return HttpResponseRedirect('/member')
> # Check that passwords are equal.
> if data['password'] != data['confirmpassword']:
> errors = 'Passwords do not match!'
> else:
Not sure what you're trying to do here, but you're returning
immediately without handling the POSTed data:
if request.POST:
data = request.POST
return HttpResponseRedirect('/member')
Fix this first, then move on to the other fixes suggested in this
thread.
Don
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---