Metadata-Version: 2.0
Name: django-improved-user
Version: 0.4.0
Summary: A custom Django user model for best practices email-based login.
Home-page: https://github.com/jambonsw/django-improved-user/
Author: Russell Keith-Magee, Andrew Pinkham
Author-email: UNKNOWN
License: Simplified BSD License
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Requires-Dist: django (>=1.8)
Provides-Extra: factory
Requires-Dist: Faker (==0.7.18); extra == 'factory'
Requires-Dist: factory-boy (==2.9.2); extra == 'factory'
Requires-Dist: python-dateutil (==2.6.1); extra == 'factory'

Read Me
=======

This project provides a custom user model that improves on Django's
default by making a few modern and international changes.

* Uses email as the username to simplify login for users
* Replace ``first_name`` and ``last_name`` with international friendly
  ``short_name`` ``full name`` fields

Installation
------------

In a Terminal, use `pip` to install the package from
[PyPI](https://pypi.org/).

.. code:: console

    pip install django-improved-user

If you intend to use the `UserFactory` provided by the package to allow
for testing with [factory_boy](https://github.com/FactoryBoy/factory_boy),
you can specify so during install.

.. code:: console

    pip install django-improved-user[factory]

If you do not but wish to use the `UserFactory`, you will need to
install [factory_boy](https://github.com/FactoryBoy/factory_boy)
yourself.

Usage
-----

Perform the following steps in your ``settings.py`` file.

1. Add ``improved_user.apps.ImprovedUserConfig``
   (or simply ``improved_user``) to ``INSTALLED_APPS``
2. Define or replace ``AUTH_USER_MODEL`` with he new model, as below.

    .. code:: python

        AUTH_USER_MODEL='improved_user.User'

3. In Django > 1.9, change ``UserAttributeSimilarityValidator`` to match
   correct ``User`` fields, as shown below.

    .. code:: python

        AUTH_PREFIX = 'django.contrib.auth.password_validation.'
        AUTH_PASSWORD_VALIDATORS = [
            {
                'NAME': AUTH_PREFIX + 'UserAttributeSimilarityValidator',
                'OPTIONS': {
                    'user_attributes': ('email', 'full_name', 'short_name')
                },
            },
            # include other password validators here
        ]

Testing
-------

To run the test suite on a single version of Django (assuming you have a
version of Django installed), run the `runtests.py` script from the root
of the project.

.. code:: console

    $ python runtests.py

You can limit the tests or pass paramaters as if you had called
`manage.py test`.

.. code:: console

    $ ./runtests.py tests.test_basic -v 3

To run all linters and test multiple Python and Django versions, use
`tox`.

.. code:: console

    $ tox

You will need to install Python 3.4, 3.5, and 3.6 on your system for
this to work.


