Metadata-Version: 2.1
Name: django-nanoid
Version: 0.0.2
Summary: A tiny, secure, URL-friendly, unique string ID generator support in Django
Home-page: https://github.com/yosephbernandus/django-nanoid
Author: Yoseph Bernandus
Author-email: yosephbernandus@gmail.com
License: Apache 2.0
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Requires-Dist: Django (>=1.9)
Requires-Dist: nanoid
Requires-Dist: djangorestframework (>=3.0.0)
Provides-Extra: dev
Requires-Dist: pytest (>=7.0) ; extra == 'dev'
Requires-Dist: twine (>=4.0.2) ; extra == 'dev'

# django-nanoid
[A tiny, secure, URL-friendly, unique string ID generator for Python.](https://github.com/puyuan/py-nanoid) support in [Django](https://www.djangoproject.com/).

[![PyPI Version](https://badge.fury.io/py/django-nanoid.svg)](https://badge.fury.io/py/django-nanoid)
[![PyPI Versions](https://img.shields.io/pypi/pyversions/django-nanoid.svg)](https://pypi.python.org/pypi/django-nanoid)

### Status

This project is actively maintained.

### Installation

To install django-nanoid from [pip](https://pypi.python.org/pypi/pip):
```bash
    $ pip install django-nanoid
```

To install nanoid from source:
```bash
    $ git clone git@github.com:yosephbernandus/django-nanoid.git
    $ cd django-nanoid && python setup.py install
```

### Usage

Adding a NANOID field to your Django models is straightforward, default length is 21. Can adjust the length using max_length

```python
from django.db import models
from django_nanoid.models import NANOIDField

class Post(models.Model):
    id = NANOIDField(secure_generated=True, editable=False)
```

Passing this will automatically generate a unique identifier, with secure generated

```python
from django.db import models
from django_nanoid.models import NANOIDField

class Post(models.Model):
    post_identifier = NANOIDField(size=10, alphabetically='mnhjksloiwnhA..!@$$$!#', secure_generated=False)
```

Passing this will automatically generate a unique identifier, with non_secure_generated with custom alphabetically and length

### Contributing

If you would like to contribute, simply fork the repository, push your changes and send a pull request.
Pull requests will be brought into the `master` branch via a rebase and fast-forward merge with the goal of having a linear branch history with no merge commits.

### License

[Apache 2.0](LICENSE)

### Dependencies

* [Django](https://github.com/django/django)
* [py-nanoid](https://github.com/puyuan/py-nanoid.git)

## Changelog

### Version 0.0.2 (2023-10-19)

* Support nanoid prefix. Thanks lodye509!


