Search code examples
pythondjangouuid

how to UUID create and call?


I am making an app, how can I issue and call UUID when first running the app? I'm using Python, Django . And I have to make a call to the URL for the front.

import uuid
print uuid.uuid4()
2eec67d5-450a-48d4-a92f-e387530b1b8b

How to make it is like this.

Need to create a model?


Solution

  • just like that, calling the method uuid.uuid4() will return an object that you can assign to a variable and use it in the code...

    import uuid
    myUuid = uuid.uuid4()
    
    print(myUuid)
    
    send(myUuid)
    check(myUuid)
    ...