Git Product home page Git Product logo

django-user-management's Introduction

django-user-management

Build Status Coverage Status Requirements Status

User management model mixins and API views/serializers based on Django and djangorestframework.

All documentation is in the docs directory.

user_management model mixins give flexibility to create your own User model. By default all mixins are optional. Our mixins allow to create, identify users (from their emails instead of their username) as well as sending password reset and account validation emails.

user_management API views and serializers can be grouped into five sections:

  • auth: authenticate and destroy a user session
  • password_reset: send and confirm a request to reset a password
  • profile: retrieve/update/delete the current user profile
  • register: create an account and send an email to validate it
  • users: give a list and a detail (retrieve, update, destroy) views about users

django-user-management's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-user-management's Issues

Drop support for old versions

We currently support:

  • python
    • 2.7
    • 3.3
    • 3.4
  • django
    • 1.6
    • 1.7
    • 1.8
  • DRF
    • 3.1
    • 3.2

I think we should consider dropping support for the bold versions.

Add password complexity requirements

Security requirements of a number of projects require the site to enforce a set of complexity for passwords. Usually this is some of the following:

  • mixture of upper and lowercase letters
  • at least one number
  • at least one "special character"

Add project migration for authtoken

Having a library migration for AuthToken would avoid to create the migration with MIGRATION_MODULES in the project.

This would need to be addressed when we drop support for Django v1.6

Require email field to not be blank in EmailUserMixin

email = models.EmailField(
verbose_name=_('Email address'),
unique=True,
max_length=511,
)

Just encountered an odd thing where I could create a user with no parameters, and there was no error. It doesn't feel right that a blank email isn't validated as false.

@incuna/backend @meshy What do you think?

from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from user_management.models.mixins import VerifyEmailMixin


class User(VerifyEmailMixin, PermissionsMixin, AbstractBaseUser):
    pass

Error message indistinguishable

I'm trying to e2e test user registration and login.

When I try to log in with bad credentials I get back a 400 error with a text in non_field_errors Unable to log in with provided credentials.

When I try to log in with an unverified account I also get back a 400 error with a different non_field_errors User account is disabled.

The only way to distinguish between them is by the error text, which will break when the text changes or we change to a different language.

A possible solution would be to use a different error status or maybe add a field which describes error type in machine readable form.

Split validate_password_strength in two

In user_management/utils/validators.py, the validate_password_strength function does two different validation checks, and can throw two errors. It should be two validators.

Should the profile serializer be hyperlinked

Currently the (other) users list detail serialiser (UserSerializer) extend HyperlinkedModelSerializer however the (my) profile serializer (ProfileSerializer) does not. It is not therefore possible to identify (my) profile in the users list detail list.

Should the ProfileSerializer include a way to identify the user in the users list? Such as a public_url link?

Add VerifyUser view

A non-API view that verifies a user's email address on a GET request (accessed via a link in an email) would be a very useful thing to keep around in a library.

unresolve import 'user_management.models.mixins'

An error message is displayed in model.py.
"unresolve import 'user_management.models.mixins'"

`from django.db import models
from django.db.models import Sum

from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from user_management.models.mixins import ActiveUserMixin`

Am I missing something?

Should the user model be in this app?

I know it's abstract, but it still seems presumptuous to me. A custom user model will always be custom. This seems to be duplicating incuna/custom-user-model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.