Pgadmin - 网站无法访问错误

时间:2017-12-24 00:17:37

标签: python-3.x ubuntu pgadmin pgadmin-4

我正在尝试在ubuntu 16.04(python,nginx)上设置pgadmin,步骤详述如下,我在url中获得成功消息,访问localhost:5050。我想我可能必须在某个地方指定网址,但我不知道该在哪里做。有人知道或者我在下面犯了错误吗?

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

1 个答案:

答案 0 :(得分:0)

使用以下内容,出于某种原因设置默认服务器在第一次尝试时无法正常工作,但现在可以使用,但不确定哪些设置存在冲突。无论如何,希望它能帮助别人。

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