vendredi 23 juillet 2021

How can I make the get_random_string Django module to return only numerical values?

What should I do to my simple code below, so that it only returns numerical values?

>>> from django.utils.crypto import get_random_string
>>> get_random_string(10)
>>> 'PhaWT9X02U'

Something like: 1067603657 And if it is possible, can you recommend an id field generated in this manner?




Aucun commentaire:

Enregistrer un commentaire