Metadata-Version: 2.1
Name: django-case-insensitive-user
Version: 0.2.2
Summary: Small app that extends default Django user to have case-insensitive username.
Home-page: https://github.com/alenzeinolov/django-case-insensitive-user
Author: Alen Zeinolov
Author-email: alenzeinolov@gmail.com
License: MIT
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.2

# django-case-insensitive-user
Small app that extends default Django user to have case-insensitive username.

## Requirements
- Python 3.8 or later
- Django 4.2 or later

## Installation
1. Install `django-case-insensitive-user` using pip.
```bash
pip install requirements.txt
```
2. Add `case_insensitive_user` to `INSTALLED_APPS` list in settings.
```python
INSTALLED_APPS = [
    ...
    "case_insensitive_user",
]
```
3. Set `AUTH_USER_MODEL` to `case_insensitive_user.User` in settings.
```python
AUTH_USER_MODEL = "case_insensitive_user.User"
```

## Overriding default user model
If you want to add additional fields to the user model, you can do so by creating a new model that inherits from `case_insensitive_user.User` and adding additional fields to it. Then, set `AUTH_USER_MODEL` to the new model in settings.

```python
from django.db import models

from case_insensitive_user.models import User

class CustomUser(User):
    custom_field = models.CharField(max_length=100)
```

Make sure to set `AUTH_USER_MODEL` to the new model in settings.
```python
AUTH_USER_MODEL = "your_app.CustomUser"
```

## Features
- Works out of the box in Django admin panel
- 100% test coverage

## Configuration
Configuration is done using `CASE_INSENSITIVE_USER` optional dictionary in your settings file:
```python
CASE_INSENSITIVE_USER = {
    "VERBOSE_NAME": "Accounts",  # Display name to display in admin page for this app
    "CASE_INSENSITIVE_EMAIL": True,  # Whether to make emails case-insensitive too, False by default
}
```
