Allow Werkzeug to be configured to bind to adaptors other than localhost for testing.
parent
4190933909
commit
3eb51e93e7
|
@ -98,6 +98,16 @@ SERVER_MODE = True
|
||||||
# The default should be fine here, as it's not exposed in the app.
|
# The default should be fine here, as it's not exposed in the app.
|
||||||
DESKTOP_USER = 'pgadmin4@pgadmin.org'
|
DESKTOP_USER = 'pgadmin4@pgadmin.org'
|
||||||
|
|
||||||
|
# This configuration otion allows the user to host the application on a LAN
|
||||||
|
# Default hosting is on localhost (DEFAULT_SERVER='localhost').
|
||||||
|
# To host pgAdmin4 over LAN set DEFAULT_SERVER='0.0.0.0' (or a specific
|
||||||
|
# adaptor address.
|
||||||
|
#
|
||||||
|
# NOTE: This is NOT recommended for production use, only for debugging
|
||||||
|
# or testing. Production installations should be run as a WSGI application
|
||||||
|
# behind Apache HTTPD.
|
||||||
|
DEFAULT_SERVER = 'localhost'
|
||||||
|
|
||||||
# The default port on which the app server will listen if not set in the
|
# The default port on which the app server will listen if not set in the
|
||||||
# environment by the runtime
|
# environment by the runtime
|
||||||
DEFAULT_SERVER_PORT = 5050
|
DEFAULT_SERVER_PORT = 5050
|
||||||
|
|
|
@ -74,6 +74,8 @@ else:
|
||||||
server_port = config.DEFAULT_SERVER_PORT
|
server_port = config.DEFAULT_SERVER_PORT
|
||||||
|
|
||||||
try:
|
try:
|
||||||
app.run(port=server_port, use_reloader=(config.SERVER_MODE and app.debug))
|
app.run(host=config.DEFAULT_SERVER,
|
||||||
|
port=server_port,
|
||||||
|
use_reloader=(config.SERVER_MODE and app.debug))
|
||||||
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())
|
||||||
|
|
Loading…
Reference in New Issue