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

The current path, accounts/home.html, didn't match any of these

I've been reading the docs and several questions already answered, but nothing seems to work, so here it the question. I'm starting with django and I can't manage to get rid of the following error: Using the URLconf defined in alpha_trader.urls,…
Alvaro
  • 1,430
  • 2
  • 23
  • 41
0
votes
1 answer

Unable to Update last_login field of Django in-built user

Built in User model of django contains last_login field. I am updating last_login when user logouts from the website. views.py: def logout(request): template = loader.get_template('logout.html') print("I am Loging out... BYY",…
Jayesh Singh
  • 696
  • 1
  • 9
  • 21
0
votes
1 answer

Django Default Auth Views Url No Reverse Match

In my Django Project, I have the following in my urls.py: urlpatterns = [ path('register/', views.register, name='register'), # Registration path('login/', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'), # Login…
JCA122204
  • 1
  • 5
0
votes
0 answers

Django Authentication credentials separate from user data

I am building a system where many accounts will not have login credentials (e.g companies) unless specifically provided. In order to achieve this, I have the following account model (not implemented yet, currently designing on a piece of…
Gasim
  • 7,615
  • 14
  • 64
  • 131
0
votes
1 answer

Error NET::ERR_CERT_COMMON_NAME_INVALID from google when using Django 2.0 for password recovery through email

I am creating a "password recovery" system using django 2.0 auth and "Heroku" handles my SSL Certificate. When I send the email containing the password reset link, I get redirected to a google page with an error that looks like this: "Your…
juju
  • 884
  • 1
  • 9
  • 31
0
votes
1 answer

How to add resend interval to django activation emails?

I have set up my django backend to send the activation email (with activation link) to the user's email address provided at registration. But recently, I have been getting spam attacks where the user (or bot or whatever) requests the activation link…
user1934283
  • 124
  • 4
  • 15
0
votes
0 answers

django-registration with password containing special chars

I would like to create a sign in/registration page. I saw that the default django library does not provide such function (any reason why?), however it seems that the library django-registration can help me. However, I don't like the default settings…
tobiasBora
  • 1,542
  • 14
  • 23
0
votes
1 answer

How to save the users last logout time

I am looking to save the users last logout time.My idea was to add it to the users profile model. I am using Django 1.11.15 Example: class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) ... …
0
votes
1 answer

Return values of custom authentication in Django REST Framework

I'm trying to write my basic custom authentication for Django REST Framework. I have the following auth backend: class JoeAuth(authentication.BaseAuthentication): def authenticate(self, request): username =…
mart1n
  • 5,969
  • 5
  • 46
  • 83
0
votes
1 answer

Django form.isValid() always return false in custom user model

I have a custom user model in django following this tutorial. But when I update a user, I receive the error message "User with this Email address already exists.". As my model extends AbstractBaseUser, does this isn't handled by django itself? My…
cwhisperer
  • 1,478
  • 1
  • 32
  • 63
0
votes
1 answer

Why doesn't Django 2.1 login_required work when parameter is present

In urls.py I have: path('/admin/', admin.site.urls), path('/admin/login', login_required(admin.site.login)), path('/customlogin/', include('customlogin.urls', namespace='customlogin')) This redirects to a custom authentication view, specified in…
0
votes
1 answer

Getting a related model class from auth.models.User

I'm working on an app that has three "profile" models types. Each of these models has a foreign key to the contrib.auth.models User model. I would like to have a single sign on for each model type and provide a redirect via classmethod depending on…
Brandon Taylor
  • 33,823
  • 15
  • 104
  • 144
0
votes
1 answer

NoReverseMatch at / Reverse for 'dashboard' with no arguments not found. 1 pattern(s) tried: ['(?P[^/]+)\\/$']

I get this error NoReverseMatch at / Reverse for 'dashboard' with no arguments not found. 1 pattern(s) tried: ['(?P[^/]+)\\/$']. After a users clicks the login button its expected that the url should redirected to 'domain/username.html',…
Bayo
  • 31
  • 7
0
votes
1 answer

Using Django UserPassesTestMixin with LoginRequiredMixin to go to an authorized URL

I'm trying to write a mixin that will protect views by first checking if someone is logged in and then if they have been onboarded. It seems to work, by blocking views it's attached to, but it the URLjust goes to a 403 forbidden. Any ideas on how to…
Dave Merwin
  • 1,382
  • 2
  • 22
  • 44
0
votes
1 answer

Python Django 2 Email Verification on User SignUp

I'm working on a project using Python(3.6) and Django(2.0) in which I need to verify the user's email on registration. Here's what I have tried: App to users named as users forms.py class SignUpForm(UserCreationForm): first_name =…
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
1 2 3
99
100