Answers for ".env files in repl"

2

.env files in repl

#in the ".env" file. THIS IS FOR PYTHON
TOKEN=38zdJSDF48fKJSD4824fN
DB_USERNAME="admin" # defining variables like you'd do in python but secret
DB_PASSWORD=w0ws0secure!!

#in the "main.py" file

import os
print(os.getenv("DB_USERNAME"))
# prints "admin"
Posted by: Guest on March-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language