Skip to content

Commit

Permalink
Add site title env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdur-rahmaanJ committed Apr 12, 2024
1 parent 9367dac commit a30d2a0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<div align="center">


Expand Down Expand Up @@ -37,6 +38,8 @@ ACTIVE_FRONT_THEME = 'editorial'
ACTIVE_BACK_THEME = 'sneat'
APP_NAME = 'Demo'
ACTIVE_ICONSET = 'boxicons'
SITE_TITLE = 'Site title'
SITE_DESCRIPTION = 'Site title'
```

## Local dev
Expand Down
4 changes: 3 additions & 1 deletion pythoncms/.env_demo
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ACTIVE_FRONT_THEME = 'editorial'
ACTIVE_BACK_THEME = 'sneat'
APP_NAME = 'Demo'
ACTIVE_ICONSET = 'boxicons'
ACTIVE_ICONSET = 'boxicons'
SITE_TITLE = 'Site title'
SITE_DESCRIPTION = 'Site title'
15 changes: 12 additions & 3 deletions pythoncms/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def create_app(config_name="development"):
instance_relative_config=True,
)



load_plugins(app, global_template_variables, global_configs, config_name)
load_config_from_obj(app, config_name)
load_config_from_instance(app, config_name)
Expand Down Expand Up @@ -292,10 +294,17 @@ def sync_keyvalue_envvar(app):
'ACTIVE_BACK_THEME',os.environ.get('ACTIVE_BACK_THEME', 'sneat')
)
set_value(
'SITE_INFO',os.environ.get('SITE_INFO', 'Site Info')
'SITE_TITLE',os.environ.get('SITE_TITLE', 'Site Info')
)
set_value(
'SITE_DESCRIPTION',os.environ.get('SITE_DESCRIPTION', 'Site Description')
)
except sqlalchemy.exc.OperationalError: # on shopyo initialise command
pass
set_value(
'APP_NAME',os.environ.get('APP_NAME', 'Default App Name')
)
set_value(
'ACTIVE_ICONSET',os.environ.get('ACTIVE_ICONSET', 'boxicons')
)
except sqlalchemy.exc.OperationalError as e: # on shopyo initialise command
if os.environ.get('FLASK_DEBUG', False):
print(e)

0 comments on commit a30d2a0

Please sign in to comment.