Create NanoID for project

We need to create unique id (Unique identifier) for our project, so that It won’t be any conflicts in the future.

Make sure you are in the root directory of your project:

mkdir scripts
cd scripts

NanoID NanoID

create generate_nanoid.py in scripts:

right click on “scripts” -> New file

or type in console:

code generate_nanoid.py

NanoID

Write script that create nanoid:

import nanoid
import nanoid_dictionary as nd

if __name__ == "__main__":
    alphabet = nd.lowercase + nd.numbers
    id = nanoid.generate(alphabet, 10)
    print(id)

NanoID

Then run:

python .\generate_nanoid.py

NanoID

Result: 6aqqepemzy

cd ..
code .env 

paste the nanoid code into the .env file:

 id=[your nanoid here]

NanoID

Save (Ctr + S)

#Check id with cat:
cat .env

NanoID

Content