mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix WSGI support.
This commit is contained in:
parent
48a50ce20b
commit
050937a32a
@ -71,7 +71,7 @@ application may be configured similarly to the example below:
|
|||||||
<VirtualHost *>
|
<VirtualHost *>
|
||||||
ServerName pgadmin.example.com
|
ServerName pgadmin.example.com
|
||||||
|
|
||||||
WSGIDaemonProcess pgadmin processes=1
|
WSGIDaemonProcess pgadmin processes=1 threads=25
|
||||||
WSGIScriptAlias / /opt/pgAdmin4/web/pgAdmin4.wsgi
|
WSGIScriptAlias / /opt/pgAdmin4/web/pgAdmin4.wsgi
|
||||||
|
|
||||||
<Directory /opt/pgAdmin4/web>
|
<Directory /opt/pgAdmin4/web>
|
||||||
@ -80,4 +80,19 @@ application may be configured similarly to the example below:
|
|||||||
Order deny,allow
|
Order deny,allow
|
||||||
Allow from all
|
Allow from all
|
||||||
</Directory>
|
</Directory>
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
|
**Note:** If you're using Apache HTTPD 2.4 or later, replace the lines:
|
||||||
|
|
||||||
|
.. code-block:: apache
|
||||||
|
|
||||||
|
Order deny,allow
|
||||||
|
Allow from all
|
||||||
|
|
||||||
|
with:
|
||||||
|
|
||||||
|
.. code-block:: apache
|
||||||
|
|
||||||
|
Require all granted
|
||||||
|
|
||||||
|
Adjust as needed to suit your access control requirements.
|
@ -153,7 +153,10 @@ SECURITY_PASSWORD_SALT = 'SuperSecret3'
|
|||||||
SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
|
SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
|
||||||
|
|
||||||
# Should HTML be minified on the fly when not in debug mode?
|
# Should HTML be minified on the fly when not in debug mode?
|
||||||
MINIFY_HTML = True
|
# Note: This is disabled by default as it will error when processing the
|
||||||
|
# docs. If the serving of docs is handled by an Apache HTTPD
|
||||||
|
# instance (rather than via the app), then it can be safely enabled.
|
||||||
|
MINIFY_HTML = False
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# Server Connection Driver Settings
|
# Server Connection Driver Settings
|
||||||
|
@ -80,18 +80,20 @@ else:
|
|||||||
# Let the application save the status about the runtime for using it later.
|
# Let the application save the status about the runtime for using it later.
|
||||||
app.PGADMIN_RUNTIME = PGADMIN_RUNTIME
|
app.PGADMIN_RUNTIME = PGADMIN_RUNTIME
|
||||||
|
|
||||||
# Output a startup message if we're not under the runtime
|
# Output a startup message if we're not under the runtime and startup.
|
||||||
if not PGADMIN_RUNTIME:
|
# If we're under WSGI, we don't need to worry about this
|
||||||
print("Starting %s. Please navigate to http://localhost:%d in your browser." %
|
if __name__ == '__main__':
|
||||||
(config.APP_NAME, server_port))
|
if not PGADMIN_RUNTIME:
|
||||||
sys.stdout.flush()
|
print("Starting %s. Please navigate to http://localhost:%d in your browser." %
|
||||||
|
(config.APP_NAME, server_port))
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
app.run(
|
app.run(
|
||||||
host=config.DEFAULT_SERVER,
|
host=config.DEFAULT_SERVER,
|
||||||
port=server_port,
|
port=server_port,
|
||||||
use_reloader=((not PGADMIN_RUNTIME) and app.debug),
|
use_reloader=((not PGADMIN_RUNTIME) and app.debug),
|
||||||
threaded=config.THREADED_MODE
|
threaded=config.THREADED_MODE
|
||||||
)
|
)
|
||||||
except IOError:
|
except IOError:
|
||||||
app.logger.error("Error starting the app server: %s", sys.exc_info())
|
app.logger.error("Error starting the app server: %s", sys.exc_info())
|
||||||
|
8
web/pgAdmin4.wsgi
Normal file
8
web/pgAdmin4.wsgi
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
root = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
if sys.path[0] != root:
|
||||||
|
sys.path.insert(0, root)
|
||||||
|
|
||||||
|
from pgAdmin4 import app as application
|
Loading…
Reference in New Issue
Block a user