-
In your local_settings.py file:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'django_%s' % (PROJECT_NAME,), 'USER': xxxx, 'PASSWORD': xxxx, 'HOST': 'localhost', 'PORT': '1234', } }
-
SSH to development server.
To connect to the production server, from the command line, run:
$ ssh -N -L 1234:localhost:5432 remote.com
- 1234 = local port
- 5432 = remote port
Important: Don't close shell window.
Note: After entering the above command, you won't get any feedback until you exit.
-
You might need to
$ touch
your wsgi file or restart Apache (Django development server restarts automatically).
-
-
Save felipecolen/90274487628489afb15515332f61d87f to your computer and use it in GitHub Desktop.
SSH Tunneling: Map port from remote machine to your local machine so you can work from the remote DB (example using Django DB settings)...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment