On 6 Mai, 14:35, zinckiwi <[email protected]> wrote:
> First thing would be to ensure that when you submit the form back to
> itself, the querystring remains. It's all well and good to visit a
> form like this:
>
> /someapp/myform/?token=blah
>
> But if your HTML form tag is:
>
> <form action="" method="post">
>
> Then you'll lose the "?token=blah" part when you submit.
my HTML form tag is as follows:
<form method="POST" action=".">
How can I avoid losing the "?token=blah" part? I think this could be
the problem.
>
> Other than that, nothing I can spot in there that would case token to
> be blank. In other words, a request made with POST still has any
> arguments in the querystring accessible via request.GET.
>
> I'd break the code right after you extract the token:
>
> token = request.GET.get('token', ' ')
> assert False
I don't konow exactly what you mean with this. Is this some kind of
debug possibility?
>
> ...and inspect the value of token in the state output. If it looks
> fine there, just keep moving that "assert False" down till you find
> where the value is getting lost.
>
> Regards
> Scott
>
>
>
> > Hi to everybody. I am a django and python newbie and I hope that
> > someone can help me here.
> > This is my first post here.
>
> > I will first explain my problem very abstractly to confine myself to
> > only the bare necessities.
>
> > I define a function "process" in a views.py file.
>
> > BEGIN Code
>
> > def process(request, template_name)
> > token = request.GET.get('token', ' ')
> > ...
> > if request.method == 'GET':
> > some_details = getDetails(token)
> > ....
> > if 'Success' in some_details['ACK']
> > email_adress = some_details['EMAIL'][0]
> > first_name = some_details['FIRSTNAME'][0]
> > ...
> > return render_to_response(template_name, --->
> > locals(), context_instance=RequestContext(request))
>
> > if request.method == 'POST':
> > details_response = doSomething(token = token) # everytime I
> > enter this, I get empty token
> > if 'Success' in details_respone['ACK']:
> > ...
> > else:
> > error_code = details_response['L_ERRORCODE0']
> > return render_to_response(template_name, --->
> > locals(), context_instance=RequestContext(request))
>
> > END Code
>
> > My question is: how can I access the value for token when polling the
> > if request.method == 'POST'
>
> > I would appreciate any help.
>
> --
> 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
> athttp://groups.google.com/group/django-users?hl=en.
--
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?hl=en.