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
12
votes
3 answers

How to achieve authentication with django-auth-ldap?

I have an app running using django. Now i want only users that are authenticated via an openldap server to see "their view" (therefore i only need their uid after successfull authentication) How can i achieve that? I guess django-auth-ldap is the…
11
votes
3 answers

Django remote user authentication and security

I am using Django remote user authentication in a project. What I am actually using is just django.contrib.auth.RemoteUserBackend without the middleware, and manually calling authenticate after having checked with the backend that the user is…
Andrea
  • 20,253
  • 23
  • 114
  • 183
11
votes
4 answers

How to access user names and profiles with django-allauth

I'm using Django with django-allauth for social authentication. I have authentication up and running, but can anyone give simple examples of how to: show the name and avatar of a logged-in user add some information to a user's account? For…
Richard
  • 31,629
  • 29
  • 108
  • 145
11
votes
1 answer

Django: Redirect to previous page *with query string* after login

I am using django.contrib.auth and would like to redirect to the previous page after logging in. I would like something like the following: Django: Redirect to previous page after login except the redirected-to URL can contain a query…
saltycrane
  • 6,541
  • 6
  • 34
  • 43
11
votes
3 answers

How to make Django admin site accessed by non-staff user?

I would like to implement a 2nd admin site which provides a subset of feature of the primary admin site. That's possible and described in the Django docs However, I would like to limit access on the primary admin site. Some users can access the…
luc
  • 41,928
  • 25
  • 127
  • 172
11
votes
2 answers

Django AUTHENTICATION_BACKENDS import error

What is the proper way to import a custom backend in settings.py? I currently have the following in settings.py: AUTHENTICATION_BACKENDS = ('apps.apployment_site.auth.CustomAuth') where apployment_site is the app, auth is file name, and CustomAuth…
Aloke Desai
  • 1,029
  • 8
  • 17
  • 27
11
votes
2 answers

Django login redirect not working?

I go to my webpage http://localhost:8000/listings/post/, it fails the test @user_passes_test(lambda u: u.is_authenticated() and u.get_profile().shipper) as expected, and redirects me to http://localhost:8000/login/?next=/listings/post/ like it's…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
11
votes
3 answers

django-allauth: How can I add a Site for my domain?

I'm new to Django and I've installed django-allauth. I followed the docs, but I'm stuck on the Post-Installation steps: Add a Site for your domain, matching settings.SITE_ID (django.contrib.sites app). For each OAuth based provider, add a Social…
user3387367
  • 111
  • 1
  • 4
11
votes
4 answers

Django pbkdf2_sha256 JS implementation

I have a database from django and I want to work with it from Node.js. I have a task: authenticate users. Known from database: algorithm pbkdf2_sha256, salt, 10000 iterations and base64-encoded hash. What steps I must to do in JS to encode some…
SoWa
  • 314
  • 4
  • 12
11
votes
3 answers

Exclude username or password from UserChangeForm in Django Auth

I'm trying to figure out a way on how to exclude the username and/or password from the UserChangeForm. I tried both exclude and fields but I doesn't work for these two fields. Here's some code: class ArtistForm(ModelForm): class Meta: …
codingjoe
  • 1,210
  • 15
  • 32
11
votes
1 answer

Implementing Ajax requests / response with django-allauth

I am using django-allauth for one of my project. I would like to implement login/signup process via ajax. I would like to have customized signup form. I was going through their signupmixin and signup form. Sounds like I can write custom views for…
11
votes
3 answers

django-registration: how do I check whether the user is logged in before displaying a page

I followed this page to set up a django registration site. It's pretty awesome, and registration and authentication are nicely wrapped. But, it doesn't show me, how do I check if a user is logged in, who this user is, before displaying a webpage?…
CuriousMind
  • 15,168
  • 20
  • 82
  • 120
11
votes
7 answers

Making a beta code for a public django site

I'm about to put a beta version of the site I'm working on up on the web. It needs to have a beta code to restrict access. The site is written in django. I don't want to change the fundamental Auth system to accommodate a beta code, and I don't care…
defrex
  • 15,735
  • 7
  • 34
  • 45
10
votes
4 answers

In Django admin, how to filter users by group?

It gives you filter by staff status and superuser status, but what about groups?
rick
  • 4,103
  • 9
  • 37
  • 41
10
votes
2 answers

How to enable https in Django-auth generated pages?

Using the Django-auth application (Django version 1.3), I want to have my login page go to https://mysite.com/login/. Currently, I'm using: # urls.py from django.contrib.auth.views import login urlpatterns = patterns('', url(r'^login/$', login,…
John C
  • 6,285
  • 12
  • 45
  • 69