Questions tagged [django-authentication]

django-authentication refers to the built-in auth module for authentication & authorization that can be extended.

django-authentication refers to the built-in auth module for authentication & authorization that can be extended. It handles user accounts, groups, permissions and cookie-based user sessions.

See documentation.

1888 questions
0
votes
1 answer

Why is my app using the default method vs the method I imported?

I have a context processor where I'm trying to override get_and_delete_messages from forum.user_messages import get_and_delete_messages def user_messages (request): """ Returns session messages for the current session. """ …
BryanWheelock
  • 12,146
  • 18
  • 64
  • 109
0
votes
2 answers

A Django question about redirect

I've a page at / that displays a form for signup new users. When a new user registers, it will redirect to /dashboard. But when an authenticated user go to /, it should see the /dashboard page. The question is: should I put something like this in…
Fred Collins
  • 5,004
  • 14
  • 62
  • 111
0
votes
1 answer

Django fresh login required on accessing profile page

I am new to django and writing authentication system for my application. Right now I have built the basic login/logout functionality. What I want is that whenever a logged in user wants to access their profile page, they should be asked to confirm…
Rohit
  • 3,659
  • 3
  • 35
  • 57
0
votes
0 answers

Authentication failure: Login page returns DoesNotEXist for users already in the database

I am trying to grasp Python Django. I'm trying to make a bank system web application. I can register users. These users then are automatically logged in. However, after logout I cannot login the same user again. The page tells me the user does not…
0
votes
1 answer

Django LogoutView does not emit user_logged_out signal

I have an app that does not receive the user_logged_out signal that, in theory, should have been sent by LogoutView. urls.py: ... path('accounts/logout/', auth_views.LogoutView.as_view(template_name='registration/logout.html'), …
0
votes
1 answer

Django csrf_cookie_not_set

I am currently working on a project where the backend is handled by Django and frontend is handled by ReactJS. The previous developers (they are no longer in the organisation) have developed all the APIs manually. I guess they were not aware of…
0
votes
2 answers

Django and DRF: serializer for a user model

I am wrote a serializer for the User model in Django with DRF: the model: from django.contrib.auth.models import AbstractBaseUser from django.contrib.auth.models import BaseUserManager from django.db import models from django.utils.translation…
kharandziuk
  • 12,020
  • 17
  • 63
  • 121
0
votes
2 answers

Django Admin Group Issue

I hope you can help me. The thing is, I was editing a user via Django Admin, and tried to add a new group from there. The add group page didn't showed up, and uWSGI log showed as follow: *** HARAKIRI ON WORKER 3 (pid: 4763) *** HARAKIRI: --- uWSGI…
Uriel Bertoche
  • 883
  • 2
  • 13
  • 23
0
votes
1 answer

Is there any way for using csrf_token in django_rest_framework without using front end in django?

I am using django framework for making a rest api for registration but when i do that csrf_token is not set since front end is not set. So it causes post request not to execute in POSTMAN. I want some way to make my rest api without disabling the…
0
votes
1 answer

Passing custom html template doesn't work with reset password in django

I am implementing reset page for my django application. Everything works fine if i use auth_views.PasswordResetView.as_view() without passing in template_name. It uses default django provided templates and i get confirmation email and password is…
0
votes
1 answer

redirecting to two different view from a form input

I have a PostForm model form to create posts for my blog app. Now the user has two options after filling the post form he/she can publish it immediately or can put it into the drafts for later publishing. when published the user will be redirected…
0
votes
1 answer

NoReverseMatch - Resetting password in Django

I have found many similar questions to this issue. This question was one of them, but it didn't solve my problem, so I will ask my own question. I'm making a password reset page on my website. But when I go to…
Laurits L. L.
  • 417
  • 1
  • 4
  • 15
0
votes
0 answers

auth is returned as none when trying to log in user when signing up

I am trying to solve the use case where when user signs up then the user is automatically logged in and return the token of that user so that i can that token in cookies from frontend. However, I get issue "Email already registered". when i debug my…
milan
  • 2,409
  • 2
  • 34
  • 71
0
votes
0 answers

Make login/logout button defined in base.html appear in all pages that extend it

I am trying to implement login/logout functionality using the default auth system in Django 2.2. I have the following included in my base.html