Metadata-Version: 2.4
Name: django-util
Version: 0.33
Summary: A Django application that provides generic utility.
Author-email: Shawn Ng <shawn.coding.acc@gmail.com>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/shawnngtq/django-util
Project-URL: Documentation, https://shawnngtq.github.io/django-util/
Project-URL: Repository, https://github.com/shawnngtq/django-util
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Intended Audience :: Developers
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.11
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django>=4.2
Provides-Extra: countries
Requires-Dist: django-countries; extra == "countries"
Provides-Extra: phonenumber
Requires-Dist: django-phonenumber-field; extra == "phonenumber"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocstrings-python; extra == "docs"
Dynamic: license-file

# django-util

A Django application that provides generic utility.

- [django-util](#django-util)
  - [Installation](#installation)
  - [Utilities](#utilities)
  - [Reference](#reference)

## Installation

```bash
pip install django-util
```

## Utilities

Standalone helpers (no need to add the app to `INSTALLED_APPS`):

- `django_util.utility.init_django(django_dir, project_name=None)` - bootstrap Django
  from external scripts/notebooks.
- `django_util.utility.get_django_countries_dict()` - code↔name maps.
  Requires the optional `django-countries` package.
- `django_util.validators.django_validate_email(email, whitelist_domains=None)`
- `django_util.validators.django_validate_url(url, allowed_schemes=None)`
- `django_util.validators.django_validate_phone(phone, region=None)` - returns E.164.
  Requires the optional `django-phonenumber-field` package.

## Reference

<https://docs.djangoproject.com/en/4.2/intro/reusable-apps/>
