Skip to content

Instantly share code, notes, and snippets.

@rob-kistner
Last active October 4, 2020 14:54
Show Gist options
  • Select an option

  • Save rob-kistner/1c511538b93ad3e1bdb0ffd6af4dad4f to your computer and use it in GitHub Desktop.

Select an option

Save rob-kistner/1c511538b93ad3e1bdb0ffd6af4dad4f to your computer and use it in GitHub Desktop.
Django - DB Settings
#
# Required:
# pip3 install mysqlclient
#
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbname',
'USER': 'username',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': 3306,
}
}
#
# Required:
# pip3 install psycopg2
#
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'dbname',
'USER': 'username',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': 5432,
}
}
#
# No requirements, built-in
#
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'dbname',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment