load default site configuration first before merging file config
This commit is contained in:
@@ -101,16 +101,16 @@ def reparse_babycode():
|
|||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
app.config['SITE_NAME'] = 'Pyrom'
|
||||||
|
app.config['DISABLE_SIGNUP'] = False
|
||||||
|
app.config['MODS_CAN_INVITE'] = True
|
||||||
|
app.config['USERS_CAN_INVITE'] = False
|
||||||
|
app.config['ADMIN_CONTACT_INFO'] = ''
|
||||||
|
app.config['GUIDE_DESCRIPTION'] = ''
|
||||||
try:
|
try:
|
||||||
app.config.from_file('../config/pyrom_config.toml', load=tomllib.load, text=False)
|
app.config.from_file('../config/pyrom_config.toml', load=tomllib.load, text=False)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print('No configuration file found, loading defaults.')
|
print('No configuration file found, leaving defaults.')
|
||||||
app.config['SITE_NAME'] = 'Pyrom'
|
|
||||||
app.config['DISABLE_SIGNUP'] = False
|
|
||||||
app.config['MODS_CAN_INVITE'] = True
|
|
||||||
app.config['USERS_CAN_INVITE'] = False
|
|
||||||
app.config['ADMIN_CONTACT_INFO'] = ''
|
|
||||||
app.config['GUIDE_DESCRIPTION'] = ''
|
|
||||||
|
|
||||||
if os.getenv("PYROM_PROD") is None:
|
if os.getenv("PYROM_PROD") is None:
|
||||||
app.static_folder = os.path.join(os.path.dirname(__file__), "../data/static")
|
app.static_folder = os.path.join(os.path.dirname(__file__), "../data/static")
|
||||||
|
|||||||
Reference in New Issue
Block a user