Tuesday, October 31, 2017

RE: do i always have to reload/return render a page to show the errors? if i press go back on browser, i see screens with the error message

Hmmm, yes, I have a slightly different situation then.

You might want to employ something with the query string.  Django, by default, uses "next" as a parameter on the Login screen.  When the user successfully logs in, they are redirected to the URL specified in the "next" GET parameter.  It doesn't address the issue of pressing the Back button, but the user may be discouraged from pressing the back button if they actually end up on the page that they were expecting to be at in the first place.

 

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of fábio andrews rocha marques
Sent: Tuesday, October 31, 2017 1:02 PM
To: Django users
Subject: Re: do i always have to reload/return render a page to show the errors? if i press go back on browser, i see screens with the error message

 

How did you use the never_cache? Because if i just put @never_cache before the def of my view: def cadastrarprofessor(request):, it's like it doesn't do anything (i am on the login page, I go to the registration page, inform a name of a user that already exists, click "register", the system refreshes the page telling me that the user already exists and when i press the "back button" from the browser, it goes back to the registration page with empty fields, which is not what iwant. I want to go back to the login page, the page before the registration). Do I have to use @never_cache and remove all the return render from my function? What should i return instead?
On Tuesday, October 31, 2017 at 2:46:01 PM UTC-3, Matthew Pava wrote:

I had a similar issue and even tried using sessions, but I eventually found that never_cache worked beautifully for me.  I didn't have to worry about sessions any more.

 

From: django...@googlegroups.com [mailto:django...@googlegroups.com] On Behalf Of fábio andrews rocha marques
Sent: Tuesday, October 31, 2017 12:19 PM
To: Django users
Subject: Re: do i always have to reload/return render a page to show the errors? if i press go back on browser, i see screens with the error message

 

I found this topic within stackoverflow: https://stackoverflow.com/questions/10906548/django-redirect-behavior-with-back-button

 

 that seems to me that the user was having the same problem as i am. The only answer i found could work was from magicTuscan, but he just said "I would save the last site path as a session, then retrieve via the view when the page is called again via the back button". I've tried to contact him but didn't get an answer. Is it possible to override the "browser back button" behavior on django using sessions?

--
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...@googlegroups.com.
To post to this group, send email to djang...@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/3ad05d02-cecd-4560-9654-82d2ed1106ca%40googlegroups.com.
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+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/fa86e291-ad2e-4b5a-b78a-1e98327189ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment