Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django environment variables

#make .env and .template.env file
#in settings.py
import environ
env = environ.Env(DEBUG=(bool, False))
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
  environ.Env.read_env()

DEBUG = env('DEBUG')
SECRET_KEY = env('SECRET_KEY')

#in .env file, put DEBUG = True, SECRET_KEY = 'your secret key'
then in terminal, type the following command
export READ_DOT_ENV_FILE=True
Comment

PREVIOUS NEXT
Code Example
Python :: numpy expand_dims 
Python :: sort rows by values dataframe 
Python :: how to count things in a list python 
Python :: unique list values python ordered 
Python :: python insert list 
Python :: Download video from a direct URL with Python 
Python :: pandas description of dataframe 
Python :: Python NumPy swapaxis Function Example 
Python :: How to know size of Python list 
Python :: django or 
Python :: double char python 
Python :: pandas swapaxes example 
Python :: add new row to numpy array 
Python :: creating a sqlite3 table in python and inserting data in it 
Python :: heroku django procfile 
Python :: jupyter notebook plot background dark theme 
Python :: turtle star python 
Python :: buttons on canvas tkinter 
Python :: get request body flask 
Python :: loop through words in a string python 
Python :: python string contains 
Python :: Python get all keys from nested dictionary 
Python :: python tqdm 
Python :: django serializer 
Python :: python telegram bot 
Python :: custom django user model 
Python :: python snake case to camel case 
Python :: Create a single executable from a Python project 
Python :: connect snowflake with python 
Python :: how to read hdf5 file in python 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =