Your problem is not related to Django, you just need to simply put the database server's ip in DATABASES['default']['host']
, as you did.
The problem is postgresql denies remote access by default. You have to first edit the pg_hba.conf
file on your database server and put a line like this in it:
host db_name user_name 192.168.1.1/32 md5
where you put your target database and user (same as those you enter in django settings) and specify the ip range of the allowed hosts to connect to that database via that user. Then you restart postgresql and now you can remotely connect to the your database. Also check if there isn't any firewall blocking you to access that port on the database server.