Connect to different database IP address while testing?

Hi,

Is it possible in django model code to connect to the same database server though different IP addresses e.g. the localhost ip in testing or the docker network ip in production?

Many thanks,

Chris

1 Like

In the model code? No. The identification of the IP addresses to be used are specified by the DATABASES setting in the settings.py file.

It is very common to have different DATABASES settings for different deployment environments.

1 Like

Thanks Ken,

I know what to search for now…different database environments in settings.py.

Chris