How to generate random numbers in django

后端 未结 3 1836
Happy的楠姐
Happy的楠姐 2021-02-05 23:38

I want to generate automatic random numbers in a blank field while saving it in django.


EDIT

The random numbers must be unique.

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 00:06

    It is more a python thing than a django thing.

    You can find all the information about Random class here

    Good luck!

提交回复
热议问题