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
On Oct 31, 2017 11:02 AM, "fábio andrews rocha marques" <
fabioandrewsrochamarq...@gmail.com> wrote:
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
On Oct 30, 2017 4:46 PM, "fábio andrews rocha marques" <
fabioandrewsrochamarq...@gmail.com> wrote:
Let's say i have a "register a new user" View and on this page, when the
user forgets to inform a password or a username, i show a message to him on
the same page saying "you forgot the password".
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
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-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of fábio andrews rocha marques
Sent:
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
Yes, my code has an else condition that always returns a render. The
error_message is populated according to the error made by the user, like
"forgot your username","forgot password", "username already exists".
Since i always need to return an httpresponse or render in my django view,
will the
> to do this, i just have to put the @never_cache on my View's method, right?
Yes.
Upon further investigation of your code, I suggest looking into Django forms
and utilizing them. Also, you shouldn’t need to use two forms on your log-in
view. The submit button should go inside the log-in
to do this, i just have to put the @never_cache on my View's method, right?
(after importing 'from django.views.decorators.cache import never_cache').
For some reason, when i did this, the page started and i already got the
message "usuário já existe"(username already exists) and still the
Try using the @never_cache decorator on your login view.
https://docs.djangoproject.com/en/1.11/topics/http/decorators/#django.views.decorators.cache.never_cache
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of fábio andrews rocha marques
Sent: Tuesday,
That's a great suggestion. Sure, it will help on situations where i just
want the fields to be completed. But there are some fields that require a
little more feedback than that. Like, if a username already exists... I
check if it already exists using a View and checking on the database. So,
class Login(APIView):
SECRET =" demo"
def post(self, request, *args, **kwargs):
import ipdb;ipdb.set_trace()
username = request.POST.get('username')
password = request.POST.get('password')
user = Person.objects.get(username=username, password=password)
Ici (en français) :
https://openclassrooms.com/courses/developpez-votre-site-web-avec-le-framework-django
;)
Le mardi 31 octobre 2017 12:37:25 UTC+1, BARHAHIGA JANVIER a écrit :
>
>
>
> svp j'aimerai ceer un site web gratuit sur jango. qui peut m'aider à le
> faire rapidement?
>
> sorry i
Hello
Sorry or I misunderstood your problem but what about using the required field
attribute ? It will make such controls and messages be handled directly on the
client side.
Best regards.
Eric PASCUAL
Centre Scientifique et Technique du Bâtiment
290 route des Lucioles
06560 SOPHIA
svp j'aimerai ceer un site web gratuit sur jango. qui peut m'aider à le
faire rapidement?
sorry i want tocreate a web for environnement information. some on in goup
can help me to do it without to pay?
--
You received this message because you are subscribed to the Google Groups
"Django
Hi everyone,
I have just joint your Django community, so please welcome me. It’s
already been lots of joy studying Django.
Thx
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails
class Login(APIView):
def post(self, request, *args, **kwargs):
import ipdb;ipdb.set_trace()
username = request.POST.get('username')
password = request.POST.get('password')
user = Person.objects.get(username=username, password=password)
#user = user[0]
17 matches
Mail list logo