2017-04-23 22:06:55 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2024-01-01 02:43:48 -06:00
|
|
|
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
2017-04-23 22:06:55 -05:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
|
|
|
|
2016-08-18 07:43:00 -05:00
|
|
|
import os
|
|
|
|
import sys
|
2020-05-04 04:36:45 -05:00
|
|
|
|
2024-07-01 02:09:12 -05:00
|
|
|
if sys.version_info < (3, 8):
|
|
|
|
raise Exception('This application must be run under Python 3.8 or later.')
|
2020-05-04 04:36:45 -05:00
|
|
|
|
2020-04-30 06:52:48 -05:00
|
|
|
import builtins
|
2016-08-18 07:43:00 -05:00
|
|
|
|
|
|
|
root = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
if sys.path[0] != root:
|
|
|
|
sys.path.insert(0, root)
|
|
|
|
|
2017-09-18 04:33:26 -05:00
|
|
|
# Ensure the global server mode is set.
|
|
|
|
builtins.SERVER_MODE = True
|
|
|
|
|
2017-04-23 22:06:55 -05:00
|
|
|
import config
|
|
|
|
|
|
|
|
# When running it as a WSGI application, directory for the configuration file
|
|
|
|
# must present.
|
|
|
|
if not os.path.exists(os.path.dirname(config.SQLITE_PATH)):
|
|
|
|
raise Exception(
|
|
|
|
"""
|
|
|
|
Required configuration file is not present!
|
|
|
|
Please run setup.py first!"""
|
|
|
|
)
|
|
|
|
|
2016-08-18 07:43:00 -05:00
|
|
|
from pgAdmin4 import app as application
|