Search code examples
python-3.xubuntupgadminpgadmin-4

Pgadmin - Site can't be reached error


I am trying to set up pgadmin on ubuntu 16.04 (python, nginx), the steps are detailed below and I get a success message in the url to visit localhost:5050. I am thinking that I may have to specify the url somewhere but am not sure where to do this. Anyone know or have I made a mistake below?

wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.4/pip/pgadmin4-1.4-py2.py3-none-any.whl

pip install pgadmin4-1.4-py2.py3-none-any.whl

gedit lib/python3.5/site-packages/pgadmin4/config_local.py

    LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
    SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
    SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
    STORAGE_DIR = '/var/lib/pgadmin4/storage'


    CSRF_SESSION_KEY = 'sample'
    SECRET_KEY = 'sample'
    SECURITY_PASSWORD_SALT = 'sample'

cd ~/pgadmin4
source bin/activate
python lib/python3.5/site-packages/pgadmin4/pgAdmin4.py

Solution

  • Got it working with the following, for some reason setting default server didn't work the 1st time I tried it, but works now, not sure what settings were conflicting. Anyway, hopefully it helps others.

    virtualenv pgadmin4
    cd pgadmin4
    source bin/activate
    sudo apt install wget
    wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.4/pip/pgadmin4-1.4-py2.py3-none-any.whl
    
    pip install pgadmin4-1.4-py2.py3-none-any.whl
    
    gedit lib/python3.5/site-packages/pgadmin4/config_local.py
    
        **add to config_local.py**
        LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
        SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
        SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
        STORAGE_DIR = '/var/lib/pgadmin4/storage'
    
    
        CSRF_SESSION_KEY = 'sample'
        SECRET_KEY = 'sample'
        SECURITY_PASSWORD_SALT = 'sample'
    
        DEFAULT_SERVER = '**your ip here**'
    
    cd ~/pgadmin4
    source bin/activate
    python lib/python3.5/site-packages/pgadmin4/pgAdmin4.py