Houcine Cherif
Houcine Cherif

Reputation: 48

How do I connect Django from desktop to the remote Mysql Server?

I want to use Django to control the backend of my website from my desktop, so I configured a no-ip host, and added it to the remote MySql section, but I can't connect the MySql server.

I tried to change the default database hostname from localhost to the no-ip host but I can't find option to do it.

How do I do this?

Upvotes: 1

Views: 2012

Answers (1)

Michael Mior
Michael Mior

Reputation: 28753

Check the DATABASES setting in your settings.py. You should have something like

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'database',
        'USER': 'user',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '',
    }
}

Just change localhost to your desired hostname.

Upvotes: 2

Related Questions