A tiny, secure, URL-friendly, unique string ID generator support in Django
Project description
django-nanoid
A tiny, secure, URL-friendly, unique string ID generator for Python. support in Django.
Status
This project is actively maintained.
Installation
To install django-nanoid from pip:
$ pip install django-nanoid
To install nanoid from source:
$ 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
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
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
Dependencies
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_nanoid-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc0f304498c08d0d20beaf9adfc90b532909f900fb1dcc381212ca2bcb1a8908 |
|
MD5 | 836226cca01f8462e20708f1523ed305 |
|
BLAKE2b-256 | 554f0a589aca5e392ff11fa5f5e3495565f76e808385d950e3a797c8bbeb0e32 |