如何解决使用pgadmin4和apache时出现的内部服务器错误?

4

我安装了pdadmin,但当我想运行它时,出现了

500 内部服务器错误

Apache 日志显示:

AttributeError: 'ReverseProxied' 对象没有 'app' 属性

1个回答

8
根据这篇帖子,您可以通过在/usr/share/pgadmin4/web/pgAdmin4.py中添加一行"self.app = app"来进行编辑。以下是我的差异:
--- /usr/share/pgadmin4/web/pgAdmin4.py.20191205125322U.bak     2019-11-12 18:55:01.000000000 +0100
+++ /usr/share/pgadmin4/web/pgAdmin4.py 2019-12-05 14:01:01.337805713 +0100
@@ -70,6 +70,7 @@
 class ReverseProxied(object):
     def __init__(self, app):
         # https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
+        self.app = app
         try:
             from werkzeug.middleware.proxy_fix import ProxyFix
             self.app = ProxyFix(app,
这是已知的错误,但正如您所见,这个问题在与此同时被修复了:
    frank@host ~/GIT/pgadmin4/web > git log c4facc04d3^..c4facc04d3
    commit c4facc04d3b64f3902131737970727a4c8c4d2d0
    Author: Aditya Toshniwal 
    Date:   Mon Dec 2 11:40:48 2019 +0530
Fix pgAdmin4 failed to start issue after upgrading to version 4.15. Fixes #4978
    frank@host ~/GIT/pgadmin4/web > git diff c4facc04d3^..c4facc04d3
    代码差异:
    diff --git a/docs/en_US/release_notes_4_16.rst b/docs/en_US/release_notes_4_16.rst
    index dc92d0c9c..74b4f7b9d 100644
    --- a/docs/en_US/release_notes_4_16.rst
    +++ b/docs/en_US/release_notes_4_16.rst
    @@ -38,3 +38,4 @@ Bug fixes
     | `Issue #4935 `_ - 修复了可访问性问题。
     | `Issue #4964 `_ - 修复了在表/列对话框中未删除长度和精度的问题。
     | `Issue #4965 `_ - 修复了在表/列的属性对话框中未显示间隔数据类型的问题。
    +| `Issue #4978 `_ - 修复了升级到版本 4.15 后,pgAdmin4 无法启动的问题。
    diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py
    index 845ca52aa..4668458f0 100644
    --- a/web/pgAdmin4.py
    +++ b/web/pgAdmin4.py
    @@-69,6 +69,7 @@ if not os.path.isfile(config.SQLITE_PATH):
     ##########################################################################
     class ReverseProxied(object):
         def __init__(self, app):
    +        self.app = app
             # https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
             try:
                 from werkzeug.middleware.proxy_fix import ProxyFix


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接