Nikhil Taparia
Nikhil Taparia

Reputation: 1

str object is not callable in django python code

I keep getting the error that str object is not callable. my line of code is pasted below... can anyone tell me what I am doing wrong.

random = str(uuid.uuid4().hex().upper()[0:6])

Upvotes: 0

Views: 84

Answers (1)

blue note
blue note

Reputation: 29099

change hex() to hex. .hex is a property, not a function, and it already returns a string.

Upvotes: 1

Related Questions