I have just joint the Django community

2017-10-31 Thread Massoud
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 fro

Re: return jwt token as json

2017-10-31 Thread Rakhee Menon
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]

Re: I am new in django

2017-10-31 Thread BARHAHIGA JANVIER
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 use

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

2017-10-31 Thread PASCUAL Eric
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 ANTIPOLIS

Re: I am new in django

2017-10-31 Thread cjacquemet
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 wan

not able to implement jwt token using django

2017-10-31 Thread rohit . autosoft
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)

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

2017-10-31 Thread fábio andrews rocha marques
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, af

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

2017-10-31 Thread Matthew Pava
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, Oct

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

2017-10-31 Thread fábio andrews rocha marques
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 probl

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

2017-10-31 Thread Matthew Pava
> 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 form

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

2017-10-31 Thread fábio andrews rocha marques
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

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

2017-10-31 Thread fábio andrews rocha marques
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

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

2017-10-31 Thread Matthew Pava
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: Tues

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

2017-10-31 Thread fábio andrews rocha marques
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 ref

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

2017-10-31 Thread James Schneider
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". T

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

2017-10-31 Thread James Schneider
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 th

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

2017-10-31 Thread Matthew Pava
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 doe