Pylons Web应用程序中的唯一用户ID

Joh*_*ith 3 python uuid pylons cassandra

使用UUID在Python中创建唯一用户ID的最佳方法是什么?

laz*_*zy1 8

我跟uuid一起去

from uuid import uuid4
def new_user_id():
    return uuid4().hex
Run Code Online (Sandbox Code Playgroud)