DEV Community


Best Django Secret generator

ashraf_zolkopli profile image ashrafZolkopli ・1 min read

Hey Guys,

Its been a while since I last post something...

So today I thought why not share one of the best Django secret generator I had seen.

anyway the gist of the video is that with python there is a module called secrets that will generate random enough that its hard to guess... you may want to go through the whole series.. but in case you just want the code

import secrets
import string
print ("".join(secrets.choice(string.digits + string.ascii_letters + string.punctuation) for i in range (100)))   

Discussion (0)

Forem Open with the Forem app