Задать вопрос

Тел: +7 965 3737 888

489

Просмотров

0

Ответов

Random code tag

This tag solves for me a simple need: generate random and compact codes for some of my applications. Codes are not guaranteed to be unique.

Usage {% randomCode "num" %}

Example: {% randomCode "8" %} generates a random 8 characters code.

Create a file on your favorite template tags folder called randomcode.py and paste the code.

Don't forget to include {% load randomcode %} in your templates

Вопрос полезен? Да0/Нет0
file_3775.py(1.2Кб)
None