i need the code i am not able to understand by reading documenetation On Thu, Nov 21, 2019 at 1:34 AM Kasper Laudrup <laud...@stacktrace.dk> wrote:
> Hi Paras, > > I hope I'm mistaken but these lines: > > On 20/11/2019 18.52, Paras Jain wrote: > > user = User.objects.get(email=email) > > if user.password == password: > > > > Makes it look like you are storing users passwords in cleartext. > > If that is correct, then please don't do that. Never, ever. This is > hopefully just a hobby project, but still it's good to do things > correctly and learn good habits from the beginning. > > Considering your question, you generally can't as HTTP is basically > stateless, so the "details" view doesn't know about the user object you > created in your "login" view. > > A workaround for this is using session cookies which isn't exactly > trivial to handle, so thankfully Django provides a way to make that very > transparent with Django authentication: > > https://docs.djangoproject.com/en/2.2/topics/auth/ > > If you read up on that documentation you would find the answer to your > question. > > It seems a bit like your trying to reinvent something Django already > provides for you, I could be wrong of course. > > Kind regards, > > Kasper Laudrup > > -- > 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 discussion on the web visit > https://groups.google.com/d/msgid/django-users/6529ab99-2733-6511-dc86-2e8f69a7cbc0%40stacktrace.dk > . > -- 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 discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMtmBS_kd9TghqeoU99H2fjWh3ta920yzE%2B3aH7AdmODDFpX5A%40mail.gmail.com.