Postgresql can't connect application server through PGAdmin4

The same problem happened to me today:

enter image description here

And this is how I've solved it:

1) Use a text editor to open the config_distro.py file under the c:\Program Files\pgAdmin 4\v1\web folder. Change the value for SERVER_MODE from True to False, then save the change. (I have run Notepad++ as an Administrator, in order to be able to save in this protected folder.)

enter image description here

2) Go to folder c:\Users\your_name\AppData\Roaming\pgAdmin and make sure there is nothing there (delete all the files, as they are temporary and will be restored after starting pgAdmin)

enter image description here

3) Start pgAdmin

enter image description here

4) This time you will see a white box that sits - at least, on my slow laptop - about 20 seconds. (You may briefly see the original error message, but do not worry).

enter image description here

5) Meanwhile, the temporary files - required for running the application - are created.

enter image description here

6) Once the temporary files process is over, the application starts as expected.

enter image description here


Try starting the pgAdmin as administrator.


My config_distro.py was missing this line:

MINIFY_HTML=False

I added it as in the above steps and it works