semvec/pypi-packages huggingface dataset:
django-modular-user 0.2.1
Modular user model for Django
Keywords: django user model auth email phone number

# Modular user model for Django
[![PyPI version](https://badge.fury.io/py/django-modular-user.svg)](https://badge.fury.io/py/django-modular-user)

**django-modular-user** lets you easily customize Django's User model, without any compromises. Unlike Django's own `AbstractBaseUser`, here nothing is irremovable, you can use exactly the parts you want.

## Requirements
* Django 2.0+

## Installation
```sh
pip install django-modular-user
```

* Create a new Django package with following models.py, and a migrations/ subdirectory:
```python
from django_modular_user.user import AbstractUser

class User(AbstractUser):
    pass
```

* In `settings.py`, set `AUTH_USER_MODEL = 'your_new_package_name.User'`
* Run `./manage.py makemigrations`

## Configuration
You may configure the basic profile data with `USER_CORE_MODULES` setting. For example, to create an User model without usernames and passwords, that uses email as the username, you may use:
```python
USER_CORE_MODULES = [
    'django_modular_user.user:AbstractBaseUser',
    'django_modular_user.user:EmailMixin', # email
    'django_modular_user.user:NamePartsMixin', # given_name, middle_name, family_name
    'django_modular_user.user:ActiveMixin', # is_active
    'django_modular_user.user:StaffMixin', # is_staff
    'django_modular_user.user:PermissionsMixin', # is_superuser and other permissions
    'django_modular_user.user:JoinedMixin', # date_joined
]
USERNAME_FIELD = 'email'
USER_EMAIL_UNIQUE = True
```

## App-specific User mixins
`django-modular-user` automatically scans all `INSTALLED_APPS` for `user.py` modules that contain a `UserMixin` class. Such mixins are automatically added to the User model; you only need to run `./manage.py makemigrations` after adding an app to your `INSTALLED_APPS` list.
django-useful-enums 1.0.1
A useful enumeration / choice library for Django.
Keywords: django,choices,enumerations

# Useful Enums - a library for creating Enums in a DRY way in Python

[![Build
Status](https://travis-ci.org/grahambinns/django-useful-enums.png?branch=master)](https://travis-ci.org/grahambinns/django-useful-enums)

This library grew out of me getting fed up with having to create Django
choices that were lists of tuples. I far preferred nicely contained enums of
the form:

    class MyEnum:

        VALUE_1 = 1
        VALUE_2 = 2

However, most of the time you don't _need_ to create all of the IDs yourself.
You should just be able to define the key names and have the Enum class do the
work for you. `usefulenums` does that.

The syntax is very similar to the Django idiom for creating a tuple of choices:

    from usefulenums import Enum

    MyEnum = Enum(
        ("MY_FIRST_VALUE", "My First Display Text"),
        ("MY_SECOND_VALUE", "My Second Value"),
    )

However, you can now refer to those items by name in a more Pythonic fashion,
rather than having to use hard-coded strings:

    >>> MyEnum.MY_FIRST_VALUE
    0

Note that here, `Enum()` has given automatic values to the enum items. You can
set these values yourself by passing a three-tuple to `Enum` when you create
it:

    >>> MyEnum = Enum(
    ...     ("VALUE_1", "MY_FIRST_VALUE", "My First Value"),
    ...     ("VALUE_2", "MY_SECOND_VALUE", "My Second Value"),
    ... )
    >>> print(MyEnum.MY_FIRST_VALUE)
    VALUE_1

You can also extract the Django-style choices from the `Enum` so that you use
it as you've always used choices:

    >>> MyEnum.as_choices()
    (('VALUE_1', 'My First value'), ('VALUE_2', 'My Second Value'))


# Testing

`django-useful-enums` comes with unit tests that cover its behaviour. You can
run them using `nose`:

    $ pip install nose
    $ nosetests