Re: HttpResponse works but HttpResponseRedirect does not

2024-01-02 Thread Mike Dewhirst
it is doing.CheersMike--(Unsigned mail from my phone) Original message From: Alex007 MULUMBA Date: 3/1/24 08:38 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: HttpResponse works but HttpResponseRedirect does not import pandas as pd from django.http import HttpResponse # Ass

Re: HttpResponse works but HttpResponseRedirect does not

2024-01-02 Thread Alex007 MULUMBA
orm data on display. However, I > want the form cleared ready for the next set of user data. > > The following code clears the entered data but fails to download the > constructed file. > > csv = make_csv(context['result']) > > # This fails to download a csv fi

Re: HttpResponse works but HttpResponseRedirect does not

2024-01-02 Thread OSP PRO
> want the form cleared ready for the next set of user data. > > The following code clears the entered data but fails to download the > constructed file. > > csv = make_csv(context['result']) > > # This fails to download a csv file > > return HttpRe

HttpResponse works but HttpResponseRedirect does not

2024-01-01 Thread Mike Dewhirst
However, I want the form cleared ready for the next set of user data. The following code clears the entered data but fails to download the constructed file.     csv = make_csv(context['result'])     # This fails to download a csv file     return HttpResponseRedirect(     &

Re: How HttpResponseRedirect works

2021-05-25 Thread Boris Pérez
Hi!!! usually HttpResponseRedirects work with reverse function...something like this def myview(request): return HttpResponseRedirect(reverse('arch-summary', args=[1945])) where 'arch-summary' is the path name and args=[1945] the args it expects... You need to modify also

How HttpResponseRedirect works

2021-05-25 Thread Bhanu prasad Ch
HttpResponseRedirect to redirect to the progress. -- 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 view this

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-08 Thread Andréas Kühne
Cool! Keep learning - I think that django is probably one of the best COMPLETE frameworks there is - And now shortly with async support, it will be even better :) The way you can quickly prototype something that later on can continue into production is one of Pythons and Djangos strengths. Regar

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
Thank you for the feedback and advices. I will sure check out Django girls. The mix of parameters was no problem, I figured that out. I was not sure though how to write the path. But now, at least I know how to send arguments and that's bothered me for a while. Now I am on the right track again. :-

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Andréas Kühne
: > This is what I had to do. Thanks to you I know how to think and fixed it. > > > xx="EXTRA ARGUMENT" > return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,))) > > > path('//result/', views.result, name='result'),

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
This is what I had to do. Thanks to you I know how to think and fixed it. xx="EXTRA ARGUMENT" return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,))) path('//result/', views.result, name='result'), def result(request, que

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
Hi Again I finally got it to work now. return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,))) path('//result/', views.result, name='result'), (I think you mixed up the order of int:question here, you wrote question:int) xx="

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
n thing in webb application is this hard to understand than I must find something else. Passing arguments is the most common thng so I can't understand why Django doesn't offer any example. Anyway what I want to do is this. I have this call: return HttpResponseRedirect(reverse(

Re: Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Andréas Kühne
n understand or that works. But I am very new on Django so > maybe I could have missed it. But there must be an easy answer to my > question. I am following the tutorial for Django and at section 4 they use > the httpresponseredirect to go to next page after posting a form. > > &

Django tutorial, HttpResponseRedirect, sending multiple arguments

2020-05-07 Thread Ekberg Peter
the httpresponseredirect to go to next page after posting a form. return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) The views page function looks like this: def detail(request, question_id): My question is: How can I send more arguments than the question

Re: Call a URLpattern via POST from a Django view through HttpResponseRedirect

2019-09-01 Thread Gil Obradors
t; form = DateForm(request.POST) >> if form.is_valid(): >> date = form.cleaned_data['date'] >> print(type(date)) >> return HttpResponseRedirect('schedule/{date}') >> >> else: >>

Re: Call a URLpattern via POST from a Django view through HttpResponseRedirect

2019-09-01 Thread Most. Runa
date = form.cleaned_data['date'] > print(type(date)) > return HttpResponseRedirect('schedule/{date}') > > else: > form = DateForm() > > return render(request, 'app/date.html', {'form': form}) &

Call a URLpattern via POST from a Django view through HttpResponseRedirect

2019-06-14 Thread Rohit Thapliyal
Here's the Django view: def get_date(request): if request.method == 'POST': form = DateForm(request.POST) if form.is_valid(): date = form.cleaned_data['date'] print(type(date)) return HttpResponseRedirect(&#x

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2019-05-13 Thread shilpa rani
ackends to work with Django >> 1.4 or newer. >> >> Basically: >> >> 1. authenticate() works. request.user.is_authenticated() is True >> 2. Django's own login() seems to work, as request.user is set, >> request.session is set etc. >> 3. After the HttpR

Re: HttpResponseRedirect failed in django 2.1

2018-12-24 Thread Akshay Surya
Try return HttpResponseRedirect("/login/") instead of return HttpResponseRedirect("login") On Monday, December 24, 2018 at 7:35:13 PM UTC+5:30, ali reza wrote: > > Greetings! > > > Question: > I wrote a view (def register(request)) to check if DB is empty,

HttpResponseRedirect failed in django 2.1

2018-12-24 Thread ali reza
Greetings! Question: I wrote a view (def register(request)) to check if DB is empty, user can to create a new SuperUser. When DB is empty, “register” view works fine on GET request. but when user is submitting her/his info (via POST request), then he/she must be redirected to “login” url (me

Re: render_to_response and HttpResponseRedirect

2015-03-11 Thread elcaiaimar
dicionobra.html' but I also want to redirect to the page > "/edicionobra/". In the code below I send the values and I go to > edicionobra.html, however, the URL is /nuevacuenca/ and that's wrong. > > I've tried to put HttpResponseRedirect("/edicionobra/")

render_to_response and HttpResponseRedirect

2015-03-11 Thread elcaiaimar
27;s wrong. I've tried to put HttpResponseRedirect("/edicionobra/") at the end of the form, but then I don't send the values How can I solve my problem? def NuevaCuenca(request): if not request.user.is_authenticated(): return HttpResponseRedirec

Unit testing - return HttpResponseRedirect('/accounts/loggedin')

2014-07-04 Thread Pepsodent Cola
Hi coverage has highlighted that I have no unit test for the line, regarding *HttpResponseRedirect('/accounts/loggedin')*. How can I write a test that makes Coverage happy regarding this? views.py def auth_view(request): username = request.POST.get('username'

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2014-06-13 Thread Scott Simmerman
. > > Basically: > > 1. authenticate() works. request.user.is_authenticated() is True > 2. Django's own login() seems to work, as request.user is set, > request.session is set etc. > 3. After the HttpResponseRedirect, request.user is AnonymousUser > > This has happe

Re: HttpResponseRedirect vs render_to_response

2014-05-18 Thread Daniel Roseman
is-the-difference-b-w-httpresponse-vs-httpresponseredirect-vs-rende > -- the accepted answer it is stated that after a successful > post that HttpResponseRedirect should be used. I understand that it may > be "cleaner" to do this, but I was wondering how best to pass variab

HttpResponseRedirect vs render_to_response

2014-05-18 Thread Colin Ma
Hello, I know there are a bunch of threads on this topic (on stacked overflow at least), but I am having trouble understanding something. In this post: http://stackoverflow.com/questions/1921523/django-what-is-the-difference-b-w-httpresponse-vs-httpresponseredirect-vs-rende -- the accepted

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-11-11 Thread Hanne Moa
The fix that worked for 1.4.x did not work for 1.5.x. Only thing that worked for 1.5.x was changing how apache called django, by setting WSGIDaemonProcess to "processes=1" or removing "processes" entirely ("threads" can be lots more than one). Something has obviously changed in how django does wsg

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-22 Thread Praveen Madhavan
Hi, Can you please exlpain it further. I am facing the same issue. I have written a get_user() method in my customauthentication.py. My authentication is successful but the subsequent requests show up as anonymous user. Thanks Praveen.M On Monday, 21 October 2013 16:28:12 UTC+5:30, HM wro

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-21 Thread Hanne Moa
Turns out: the auth backend that worked in 1.3 but not in 1.4+ was missing a get_user()-method. I added it in and that was that. HM -- 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 i

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Hanne Moa
On 14 October 2013 17:06, Tom Evans wrote: > On Mon, Oct 14, 2013 at 1:52 PM, Hanne Moa wrote: > > I can't get logging in with alternate auth backends to work with Django > 1.4 > > or newer. > > Are you sure sessions are working correctly? Are you setting cookies > (for session or otherwise) w

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Tom Evans
to work, as request.user is set, > request.session is set etc. > 3. After the HttpResponseRedirect, request.user is AnonymousUser > > This has happened twice now, with different alternate auth backends. I can't > get rid of Django 1.3 before this is fixed... > > In one project I

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Sergiy Khohlov
gt; str = reverse('cm_base.views.index') >> return HttpResponseRedirect(str) >> else: >> # Their password / email combination must have been incorrect >> pass >> >> you are verifying fields only. No more. And in

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Hanne Moa
ogin(request, form.get_user()) > str = reverse('cm_base.views.index') > return HttpResponseRedirect(str) > else: > # Their password / email combination must have been incorrect > pass > > you are verifying fields only. No more. And invali

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Hanne Moa
k with Django > 1.4 > > or newer. > > > > Basically: > > > > 1. authenticate() works. request.user.is_authenticated() is True > > 2. Django's own login() seems to work, as request.user is set, > > request.session is set etc. > > 3. After the

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Sergiy Khohlov
Take a look at : if form.is_valid(): #django.contrib.auth.login Login(request, form.get_user()) str = reverse('cm_base.views.index') return HttpResponseRedirect(str) else: # Their password / email combination must have been incorrect

Re: Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Sergiy Khohlov
s own login() seems to work, as request.user is set, > request.session is set etc. > 3. After the HttpResponseRedirect, request.user is AnonymousUser > > This has happened twice now, with different alternate auth backends. I can't > get rid of Django 1.3 before this is fixed... &

Auth backends don't work with HttpResponseRedirect and Django 1.4+?

2013-10-14 Thread Hanne Moa
I can't get logging in with alternate auth backends to work with Django 1.4 or newer. Basically: 1. authenticate() works. request.user.is_authenticated() is True 2. Django's own login() seems to work, as request.user is set, request.session is set etc. 3. After the HttpRespon

Django 1.4.4 HttpResponseRedirect to a PUT causing a second PUT?

2013-05-12 Thread John
I have an endpoint for renaming an object. After the update occurs, the view function returns an HttpResponseRedirect to redirect the client to the restful endpoint now representing that object (since it has been renamed). The update is a PUT. I expect the 302 redirect to cause my browser to

Re: django-filetransfers and HttpResponseRedirect

2013-04-29 Thread Venkatraman S
On Mon, Apr 29, 2013 at 3:43 PM, Shawn Milochik wrote: > Use HttpResponseRedirect, as you mention in your subject line. > Question is 'why'? -V -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

Re: django-filetransfers and HttpResponseRedirect

2013-04-29 Thread Shawn Milochik
Use HttpResponseRedirect, as you mention in your subject line. -- 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...@googlegrou

Re: django-filetransfers and HttpResponseRedirect

2013-04-28 Thread Venkatraman S
Following this up... any thoughts? On Thu, Apr 4, 2013 at 9:34 AM, Venkatraman S wrote: > > I use django-filetransfers in my app and had a quick Q on one of the > comments by the author in this post : > http://www.allbuttonspressed.com/projects/django-filetransfers > > He mentions "Note that i

django-filetransfers and HttpResponseRedirect

2013-04-03 Thread Venkatraman S
I use django-filetransfers in my app and had a quick Q on one of the comments by the author in this post : http://www.allbuttonspressed.com/projects/django-filetransfers He mentions "Note that it's important that you send a redirect after an upload. Otherwise, some file hosting services won't work

Re: sending data with HttpResponseRedirect

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
Actually, just seen that flash hasn't been maintained, and my own personal usage of it was touch and go at best These days, I also tend to use the approach of storing a message in the session instead (as explained by Jirka). Cal On Wed, Sep 12, 2012 at 2:35 PM, Jirka Vejrazka wrote: > If you ha

Re: sending data with HttpResponseRedirect

2012-09-12 Thread Simon Cossar
thank's, that's just what I was looking for. On Wed, Sep 12, 2012 at 6:35 AM, Jirka Vejrazka wrote: > If you have sessions enabled, you can use the built-in messages > framework (look in contrib) to display a message on the "next" page. > Alternatively, you can save (semi-) arbitrary data in the

Re: sending data with HttpResponseRedirect

2012-09-12 Thread Jirka Vejrazka
If you have sessions enabled, you can use the built-in messages framework (look in contrib) to display a message on the "next" page. Alternatively, you can save (semi-) arbitrary data in the user session and retrieve it in the view that displays the "success" page. HTH Jirka -- You receiv

Re: sending data with HttpResponseRedirect

2012-09-12 Thread Cal Leeming [Simplicity Media Ltd]
that after > successfully processing a form uses HttpResponseRedirect() to send the user > to a 'success' page. Is their a standard way of accessing the form data > from the previous page so that I can echo some of the submitted data back > to them? > > Simon > > -- > You

sending data with HttpResponseRedirect

2012-09-12 Thread Simon Cossar
Hi All, I'm just starting to play around with Django... working through the tutorial and the Django Book. I have just written a view that after successfully processing a form uses HttpResponseRedirect() to send the user to a 'success' page. Is their a standard way of accessing the

Re: deprecation warning from HttpResponseRedirect(reverse(...))

2012-08-20 Thread Paul Backhouse
-0700, Mike wrote: > > > On Saturday, August 18, 2012 1:31:42 PM UTC+2, Paul Backhouse wrote: > > I seem to be getting a DeprecationWarning when my view hits > this line of > > code: > > > > return HttpRespons

Re: deprecation warning from HttpResponseRedirect(reverse(...))

2012-08-18 Thread Mike
On Saturday, August 18, 2012 1:31:42 PM UTC+2, Paul Backhouse wrote: > > > I seem to be getting a DeprecationWarning when my view hits this line > of > > code: > > > > return HttpResponseRedirect(reverse(results, args=[query.jobid])) > > > &

Re: deprecation warning from HttpResponseRedirect(reverse(...))

2012-08-18 Thread paulb
> I seem to be getting a DeprecationWarning when my view hits this line of > code: > > return HttpResponseRedirect(reverse(results, args=[query.jobid])) > What does the depreciation warning say? -- You received this message because you are subscribed to the Google Groups

deprecation warning from HttpResponseRedirect(reverse(...))

2012-08-17 Thread Mike
I seem to be getting a DeprecationWarning when my view hits this line of code: return HttpResponseRedirect(reverse(results, args=[query.jobid])) I'm not directly using any generic views here. Is this a bug? If not, what is the right way to redirect to a different view? That line of

Re: Django Sessions - HttpResponseRedirect

2012-07-01 Thread M Oklah
I saw that post and set request.session.modified = True before redirecting in the view with no luck! Any other ideas? Thanks, -Moe On Sun, Jul 1, 2012 at 4:08 PM, Alagappan wrote: > I think someone has faced a similar issue as yours. Find more details at: > > http://stackoverflow.com/question

Django Sessions - HttpResponseRedirect

2012-07-01 Thread M Oklah
Hello, Why is it that the session id changes after a redirect is initiated from a view function? This is basically the scenario, after the browser makes a POST request to a custom login() view function, the view function authenticates the user and redirects (302) the user back to a page, but the r

Re: Sessions living through HttpResponseRedirect

2012-04-24 Thread Alexandr Aibulatov
Set request.session.modified = True 2012/4/24 sspross : > Hi Joshua > > What was your solution here? It looks like I'm having the same kind of > problem like you: > > http://stackoverflow.com/questions/10293467/losing-session-after-httpresponseredirect > > Thx!

Re: Sessions living through HttpResponseRedirect

2012-04-24 Thread sspross
Hi Joshua What was your solution here? It looks like I'm having the same kind of problem like you: http://stackoverflow.com/questions/10293467/losing-session-after-httpresponseredirect Thx! Regards, Silvan On Wednesday, April 1, 2009 4:47:17 AM UTC+2, Joshua K wrote: > >

Re: Using Context Processor as form with HttpResponseRedirect

2012-02-01 Thread Jenna Pullen
support a request and can > do the validation why not? Basically stuck on using > HttpResponseRedirect in a context processor. I have managed to get > this working by passing a variable called redirect in the dictionary > returned to my template and then saying if the redirect tag is >

Re: Using Context Processor as form with HttpResponseRedirect

2012-02-01 Thread Daniel Roseman
lidation why not? Basically stuck on using > HttpResponseRedirect in a context processor. I have managed to get > this working by passing a variable called redirect in the dictionary > returned to my template and then saying if the redirect tag is > available use the browsers meta tag

Using Context Processor as form with HttpResponseRedirect

2012-01-31 Thread richard
context processor after is_valid is called. Are context processors not supposed ot be used in this way? My thoughts inititally were that if it seems to support a request and can do the validation why not? Basically stuck on using HttpResponseRedirect in a context processor. I have managed to get this

Re: HttpResponseRedirect adds hostname?

2011-08-23 Thread Roy Smith
Thanks for the explanation. We ended up re-arranging which pieces were listening on which ports so the nginx front end is on port 80. Reading the nginx docs, it seems like we might have been able to make our current set up do what we wanted, but shuffling the ports was easier :-) Regarding:

Re: HttpResponseRedirect adds hostname?

2011-08-23 Thread Jacob Kaplan-Moss
On Tue, Aug 23, 2011 at 4:01 PM, Jacob Kaplan-Moss wrote: > However, I believe it's not actually Django doing the rewriting. Scratch that: I'm wrong. Actually, Django *is* doing the re-writing: see https://code.djangoproject.com/browser/django/trunk/django/http/utils.py#L11. Still, the point st

Re: HttpResponseRedirect adds hostname?

2011-08-23 Thread Jacob Kaplan-Moss
API clients, testing utilities, ...). However, I believe it's not actually Django doing the rewriting. if you peer through the implementation of HttpResponseRedirect (https://code.djangoproject.com/browser/django/trunk/django/http/__init__.py#L689), you'll see that i there's nowhere

HttpResponseRedirect adds hostname?

2011-08-23 Thread Roy Smith
I've got a view which does returns HttpResponseRedirect('/'). When I look at the HTTP traffic in tcpdump, I can see that the location header has had the hostname added: Location: http://gilbert.lic.songza.com/ Why does it do this? It seems like it should just take the string I

Re: why will HttpResponseRedirect prevent re submit of form?

2010-12-20 Thread Tom Evans
On Mon, Dec 20, 2010 at 10:02 AM, Mingming Wang wrote: > Thanks a lot Javier! It takes me days to understand this. > Hm...what if we don't use Redirect, what will happen in the wire? is it the > following? If so, then no re submit problem lor. I must missed something > out. > <-  GET /yourapp/vote

Re: why will HttpResponseRedirect prevent re submit of form?

2010-12-20 Thread Mingming Wang
edirect or a direct response? Refer the > > comments below. Thanks a lot! > > HttpResponseRedirect returns a 301 or 302 response code to the > browser, instead of more common 200 (ok), or 404 (not found). That > simply instructs the browser to load the given URL. The interestin

Re: why will HttpResponseRedirect prevent re submit of form?

2010-12-19 Thread Javier Guerra Giraldez
On Sat, Dec 18, 2010 at 11:06 AM, Mingming Wang wrote: > From the tutorial of Django, there is the following code in here > Who knows the mechanism behind a redirect or a direct response? Refer the > comments below. Thanks a lot! HttpResponseRedirect returns a 301 or 302 response co

why will HttpResponseRedirect prevent re submit of form?

2010-12-18 Thread Mingming Wang
hanks a lot! from django.shortcuts import get_object_or_404, render_to_responsefrom django.http import HttpResponseRedirect, HttpResponsefrom django.core.urlresolvers import reversefrom django.template import RequestContextfrom polls.models import Choice, Poll# ...def vote(request, poll_id): p =

Re: HttpResponseRedirect

2010-08-09 Thread bagheera
est, 'show_admin' : request.user.is_authenticated(), 'ty_message' : ty_messages.get(ty_msg_id, ty_messages['']), }) t = get_template('ThankYou.html') html = t.render(c) return HttpResponse(html) # usage example return H

Re: HttpResponseRedirect

2010-08-07 Thread JeffH
er.is_authenticated(), 'ty_message' : ty_messages.get(ty_msg_id, ty_messages['']), }) t = get_template('ThankYou.html') html = t.render(c) return HttpResponse(html) # usage example return HttpResponseRedirect('/ThankYou/0089'

Re: HttpResponseRedirect

2010-08-07 Thread bagheera
Dnia 07-08-2010 o 10:29:30 bagheera napisał(a): Dnia 06-08-2010 o 18:09:12 shacker napisał(a): Why not use the Messages framework for this? http://docs.djangoproject.com/en/dev/ref/contrib/messages/ ./s That looks promising, i'll try to figure that out. It works as intended, thanks sha

Re: HttpResponseRedirect

2010-08-07 Thread bagheera
Dnia 06-08-2010 o 18:09:12 shacker napisał(a): Why not use the Messages framework for this? http://docs.djangoproject.com/en/dev/ref/contrib/messages/ ./s That looks promising, i'll try to figure that out. -- Linux user -- You received this message because you are subscribed to the Google

Re: HttpResponseRedirect

2010-08-06 Thread shacker
Why not use the Messages framework for this? http://docs.djangoproject.com/en/dev/ref/contrib/messages/ ./s -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from

Re: HttpResponseRedirect

2010-08-06 Thread marekw2143
Daniel, I think it can work incorrectly when user would be filling more than one form of the same type at the same time. My suggestion is to use passing get parameters while returning HttpResponseRedirect. It of course have disadvantage that the address would not be always same (get params will be

Re: HttpResponseRedirect

2010-08-06 Thread marekw2143
So when returning HttpResponseRedirect django returns 302 status code for the client, which indicates that the client browser should navigate to another url. Then you have at last 2 options: 1) before returning save at session data information about form that you want to thans form - but it'

Re: HttpResponseRedirect

2010-08-06 Thread Daniel Roseman
directs to "/' if no redirection took place (like user typed in browser   > "test.com/thanks") > Unfortunately,  HttpResponseRedirect takes only one argument. How can i   > pass right message anyway? Or mb there is some workaround, like i could   > check in &quo

HttpResponseRedirect

2010-08-06 Thread bagheera
ce (like user typed in browser "test.com/thanks") Unfortunately, HttpResponseRedirect takes only one argument. How can i pass right message anyway? Or mb there is some workaround, like i could check in "thanks" view, from what page it was redirected? -- Linux user -- You r

Re: HttpResponseRedirect(request.path) after request.POST issue

2010-05-14 Thread marty3d
I finally went half and half here, by posting to an /vote// url. Personally, I think handling the GET in the tag and the POST in a view is a bit messy, but perhaps I find a better solution later. After I got that to work properly, I also implemented an ajax version. I have never done that in Django

Re: HttpResponseRedirect(request.path) after request.POST issue

2010-05-14 Thread Tom Evans
On Thu, May 13, 2010 at 6:11 PM, marty3d wrote: > Thanks, that's a shame... > So I'm now trying to do the request.POST stuff in a view instead. > Since the idea is to have the voting app as decoupled as possible, is > there a slick way to pass, perhaps the whole object in this case, but > at least

Re: HttpResponseRedirect(request.path) after request.POST issue

2010-05-13 Thread marty3d
ust be a "ContentType" instance. new_vote.content_type = ContentType.objects.get_for_id(form.cleaned_data['content_type']) #This SHOULD work, right? new_vote.save() return HttpResponseRedirect('/news/1/') #To make dynamic once the above code work Thanks, /Martin On May 13, 8:14 pm,

Re: HttpResponseRedirect(request.path) after request.POST issue

2010-05-13 Thread Daniel Roseman
On May 13, 6:11 pm, marty3d wrote: > Thanks, that's a shame... > So I'm now trying to do the request.POST stuff in a view instead. > Since the idea is to have the voting app as decoupled as possible, is > there a slick way to pass, perhaps the whole object in this case, but > at least the name of

Re: HttpResponseRedirect(request.path) after request.POST issue

2010-05-13 Thread marty3d
> >                 if form.is_valid(): > >                         new_vote = form.save(commit=False) > >                         new_vote.object_id = object.pk > >                         new_vote.content_type = item_type > >                         new_vote.save() > >                         retu

Re: HttpResponseRedirect(request.path) after request.POST issue

2010-05-13 Thread Daniel Roseman
;POST': >                 form = VoteForm(request.POST) >                 if form.is_valid(): >                         new_vote = form.save(commit=False) >                         new_vote.object_id = object.pk >                         new_vote.content_type = item_type

HttpResponseRedirect(request.path) after request.POST issue

2010-05-13 Thread marty3d
new_vote.object_id = object.pk new_vote.content_type = item_type new_vote.save() return HttpResponseRedirect(request.path) else: form = VoteForm() return { &#x

Re: HttpResponseRedirect and user message

2010-05-04 Thread Daniel Roseman
On May 4, 9:43 am, xpanta wrote: > Thank you. One more thing: how to save info in the session? Read the fine documentation: http://docs.djangoproject.com/en/1.1/topics/http/sessions/ -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: HttpResponseRedirect and user message

2010-05-04 Thread xpanta
Thank you. One more thing: how to save info in the session? On 4 Μάϊος, 11:27, "ge...@aquarianhouse.com" wrote: > i would use reverse and redirect to a "success" page > > def my_view(request): >     #do stufff >     #save info in session >     return Htt

Re: HttpResponseRedirect and user message

2010-05-04 Thread ge...@aquarianhouse.com
i would use reverse and redirect to a "success" page def my_view(request): #do stufff #save info in session return HttpResponseRedirect(reverse('success_url')) def my_success_view(request): #access the session and get the data return render_to_response(&#

HttpResponseRedirect and user message

2010-05-04 Thread xpanta
Hi, I am new to django, and I have this simple task i need to accomplish. in views.py there is a function that processes an html form (with POST action). This function returns an HttpResponseRedirect object. This object gets as parameters the redirect action, like this: return

HttpResponseRedirect waiting for something

2010-02-25 Thread adrian
datetime.datetime.now(), result) order_file.close() return True if result else False @login_required def store_config(request): # get store for user, see if user can edit settings profile = check_perms(request, 'can_edit_settings') if profile == 'error'

Re: int argument required error in HttpResponseRedirect

2010-01-16 Thread Cummins Group
It worked as follows: return HttpResponseRedirect('/userans/%s/%s/' % (uno,qno)) Thank you for helping.. On Sat, Jan 16, 2010 at 3:36 PM, Daniel Roseman wrote: > On Jan 16, 8:38 am, grp25 wrote: > > The code which we have written is > > re

Problems with HttpResponseRedirect(reverse()) No match found

2010-01-07 Thread Mac
message+': Phone '+phone +': Name '+name from django.core.mail import send_mail send_mail(subject, message, your_email, ['malc...@sporthill.com']) else: notes='Sorry, there was a problem with your submission

Re: HttpResponseRedirect doesn't redirect in this case

2009-11-17 Thread Gabriel .
you should "return HttpResponseRedirect" Regards. On Tue, Nov 17, 2009 at 5:04 PM, adrian wrote: > > The LOGIN_REDIRECT_URL setting points to this view, where I want to > redirect again according to the group the user is in: > > @login_required > def afte

HttpResponseRedirect doesn't redirect in this case

2009-11-17 Thread adrian
r(groups[0].name) if name == 'superadmin': print "redir superadmin" print reverse("superadminhome") HttpResponseRedirect(reverse("superadminhome")) print "here now" elif name == 'ad

Re: HttpResponseRedirect(request.META["HTTP_REFERER"])

2009-09-24 Thread Tim Chase
dijxtra wrote: > Is it safe to use HttpResponseRedirect(request.META["HTTP_REFERER"])? > Can a session be stolen using this coed by spoofing HTTP_REFERER? Two things stand out to me: 1) HTTP_REFERER is not a required header, so if the browser doesn't send it, your code won

HttpResponseRedirect(request.META["HTTP_REFERER"])

2009-09-24 Thread dijxtra
Is it safe to use HttpResponseRedirect(request.META["HTTP_REFERER"])? Can a session be stolen using this coed by spoofing HTTP_REFERER? Thanks in advance, nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: Admin interface : 'HttpResponseRedirect' object has no attribute 'rindex'

2009-08-15 Thread 3hux
elf.as_widget() > >   File "/home/pozzonuovo/django/django/forms/forms.py", line 391, in > as_widget >     return widget.render(name, data, attrs=attrs) > >   File "/home/pozzonuovo/django/django/contrib/admin/widgets.py", line > 225, in re

Re: HttpResponseRedirect with POST

2009-08-06 Thread Sławek Tuleja
min > > action) > > > for example this works: > > def add_mailing(self, request, queryset): > >         return HttpResponseRedirect('%s?subject=halo' % \ > >                                         urlresolvers.reverse > > ('admin:tend

Re: HttpResponseRedirect with POST

2009-08-06 Thread Daniel Roseman
ryset): >         return HttpResponseRedirect('%s?subject=halo' % \ >                                         urlresolvers.reverse > ('admin:tenders_mailing_add')) > > but this does not: > def add_mailing(self, request, queryset): >         p

Re: HttpResponseRedirect with POST

2009-08-06 Thread Spajderix
ks: > def add_mailing(self, request, queryset): > return HttpResponseRedirect('%s?subject=halo' % \ > urlresolvers.reverse > ('admin:tenders_mailing_add')) > > but this does not: > def add_m

HttpResponseRedirect with POST

2009-08-06 Thread Sławek Tuleja
HI everyone! Can I redirect to view with form passing few variables in POST method (request.POST) and showing them in the form? (i need this in admin action) for example this works: def add_mailing(self, request, queryset): return HttpResponseRedirect('%s?subject

Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs
Ticket #11638 ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+un

Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs
92. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ decorators.py" in __call__ 78. return self.view_func(request, *args, **kwargs) File "/var/www/filez/filezupload/views.py&

  1   2   3   >