Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to access the db which is there on my windows 7 machine through centos mounted on oracle virtual box. I am using python as the language, using Django.

I have made the following changes to settings.py:

DATABASES = {
'default': {
    'NAME': 'tri_prod',
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'USER': 'postgres',
    'PASSWORD': 'cwise',
    'PORT' : '5432',
    'HOST' : '192.168.0.116',
'OPTIONS' : {'autocommit': True,}
},
'alternate': {
    'NAME': 'tri_prod',
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'USER': 'postgres',
    'PASSWORD': 'cwise',
    'PORT' : '5432',
    'HOST' : '192.168.0.116'
},

I have also made changes in pg_hba.conf file in windows as

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# IPv4 local connections:
host    all             all             192.168.0.116/32        trust

This is working fine as long as i am connected to internet. When I am offline I lose the IP address so I lose the connection to my db also.

I want to know what ip address should I give so that I am able to connect even when i am offline

share

migration rejected from stackoverflow.com Jul 12 '13 at 11:16

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by slhck Jul 12 '13 at 11:16

  • This question does not appear to be about computer software or computer hardware within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Programming questions about Django/Python etc are off topic –  slhck Jul 12 '13 at 11:16

1 Answer 1

In VirtualBox NAT networking mode, the guest sees the host as 10.0.2.2.

share