Connect to MySQL

  1. Install mysql dependencies and the connector
$ pip3 install mysqlclient(Error: mysql_config not found)

mysql-config is in a different package, which can be installed 
$ sudo apt-get install libmysqlclient-dev
  1. Configure the 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',
    }
}
You would enable the environment variables setting in the system.

results matching ""

    No results matching ""