patents Posted October 30, 2017 Posted October 30, 2017 Hello, Am I eligible for allowing remote access to postgres?I am trying to work django ORM work. I tried MySQL but it doesn't work for me. if yes: username: patents_plrusr database: patents_plrdb user(off course): patents else: no worry.Access to all IPs needed as I dont have static IP.
patents Posted October 31, 2017 Author Posted October 31, 2017 I am still not able to access the remote db. I tried. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'patents_plrdb', 'USER': 'patents_plrusr', 'PASSWORD': '', 'HOST': 'tommy.heliohost.org', 'PORT': '5432', } } and 'HOST': '65.19.143.6',I not able to use it. I am on windows. I think I need to try linux now.
Krydos Posted October 31, 2017 Posted October 31, 2017 All that information looks right to me. Try this command psql --username=patents_plrusr --host=tommy.heliohost.org --dbname=patents_plrdb --port=5432 If that works then you know the problem is in your django app not on your computer or remote access.
patents Posted October 31, 2017 Author Posted October 31, 2017 (edited) Is installation of postgreSQL required on my machine to access remotely? I tried manually using python. This is the input and output: In [1]: import psycopg2 In [2]: conn = psycopg2.connect(database='patents_plrdb', ...: user='patents_plrusr', ...: password='', ...: host='tommy.heliohost.org', ...: port=5432) --------------------------------------------------------------------------- OperationalError Traceback (most recent call last) <ipython-input-4-3976c641658e> in <module>() 3 password='', 4 host='tommy.heliohost.org', ----> 5 port=5432) C:\Users\rahulkumar.patel\AppData\Roaming\plrplus\WinPython-32bit-3.6.2.0Qt5\python-3.6.2\lib\site-packages\psycopg2\__init__.py in connect(dsn, connection_factory, cursor_factory, **kwargs) 128 129 dsn = _ext.make_dsn(dsn, **kwargs) --> 130 conn = _connect(dsn, connection_factory=connection_factory, **kwasync) 131 if cursor_factory is not None: 132 conn.cursor_factory = cursor_factory OperationalError: could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "tommy.heliohost.org" (65.19.143.6) and accepting TCP/IP connections on port 5432? Edited October 31, 2017 by patents
Krydos Posted October 31, 2017 Posted October 31, 2017 Is installation of postgreSQL required on my machine to access remotely?No, I tested it on windows and this is all you need https://krydos.heliohost.org/downloads/psql.zip Extract that somewhere on your path, like c:\windows and then you'll be able to run the command psql.exe on the command prompt.
patents Posted November 1, 2017 Author Posted November 1, 2017 I am able to connect to the remote connection at home. But on my work computer it is blocked.
wolstech Posted November 1, 2017 Posted November 1, 2017 Which is fairly common for corporate networks...work has a firewall that’s blocking it. It’s a way for them to reduce the odds of company data leaving the network. I have to use the insecure cpanel login on port 80 at one of my jobs for the same reason.
Recommended Posts