Last active
May 12, 2016 04:05
-
-
Save shady-robot/5a2e3995bbb6e1433392736d146b004e to your computer and use it in GitHub Desktop.
Settings in django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to install mysql-client to connect django and MySQL: | |
(1). Make sure the MySQL is installed | |
(2). Use the following command to install the package: | |
Ubuntu: | |
$sudo apt-get install libmysqlclient-dev | |
CentOS: | |
$ sudo apt-get install mysql-devel | |
(3). inside the virtualenv | |
$ pip3 install mysqlclient | |
(4). The database connection parameters setting | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'DB_NAME', | |
'USER': 'DB_USER', | |
'PASSWORD': 'DB_PASSWORD', | |
'HOST': 'localhost', # Or an IP Address that your DB is hosted on | |
'PORT': '3306', | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment