Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

database setup in django aws

# in terminal, type
nano project_name/settings.py # remember to update Debug = False
# go to database section in settings.py
if RDS_DB_NAME in os.environ:
  DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': os.environ['RDS_DB_NAME'],
        'USER': os.environ['RDS_USERNAME']
        'PASSWORD': os.environ['RDS_PASSWORD'],
        'HOST': os.environ['RDS_HOSTNAME'],
        'PORT': os.environ['RDS_PORT'],
  	  }
	}
else:
  DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}
  
  
Comment

PREVIOUS NEXT
Code Example
Python :: generate a hash/secret python 
Python :: reverse color matplotlib 
Python :: python script to open google chrome 
Python :: qr code scanner on django 
Python :: print(((x//y)+1)*z) means in python 
Python :: Python List insert() add element at designated place 
Python :: Analyzing code samples, comparing more than 2 numbers 
Python :: python run only when list is bigger 
Python :: djangorestframework install command 
Python :: python check anangram 
Python :: python Access both key and value without using items() 
Python :: jupyter notebook print formatted text 
Python :: images in pygame 
Python :: problem 1 dot product python 
Python :: print chr character in python f string 
Python :: how to run ewa requirement.txt file 
Python :: download face_cascade.detectMultiScale 
Python :: c# script for download music from telegram channel 
Python :: can 2020 get any worse 
Python :: create loading in pyqt 
Python :: numpy symmetrize array 
Python :: Only show legend of inner donut 
Python :: python write string in multiple lines 
Python :: clear-all-widgets-in-a-layout-in-pyqt 
Python :: python read and write lines in file 
Python :: model summary change size of columns 
Python :: django save object 
Python :: numpy topk 
Python :: the most effective search method in python with example 
Python :: sample k-means clustering 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =