Skip to main content

Reusable User model with required unique email field and mid-project support.

Project description

Reusable User model with required unique email field and mid-project support.

It defines custom User model reusing of the original table (auth_user) if exists. If needed (when added to existing project), it recreates history of applied migrations in the correct order.

Adding to existing project

  • Backup the database

  • Ensure that any reference to User model (in your project and all third-party apps) uses ‘AUTH_USER_MODEL’ setting or ‘get_user_model’.

  • Ensure that there are no duplicit or empty emails in table ‘auth_user’.

  • Test it on a clone of your project, before you try to deploy it to production server.

Installation

pip install django-user-unique-email

Configuration

Add ‘user_unique_email’ to INSTALLED_APPS and set AUTH_USER_MODEL in settings:

# Add user_unique_email to INSTALLED_APPS
INSTALLED_APPS.append('user_unique_email')

# Custom User model
AUTH_USER_MODEL = 'user_unique_email.User'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-user-unique-email-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file django-user-unique-email-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-user-unique-email-0.1.1.tar.gz
Algorithm Hash digest
SHA256 96267102831538df902494c474e9f6907bca9c5c903c3b5beaf9e864311e7a58
MD5 bf654ce78476a543ea8dc656b7c5f9e7
BLAKE2b-256 28bc17720231a18844dc3d901c6174582bdd71a512e3ae3f679476db0c55a98c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page