Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add flag to control starting the server on bootstrap

Roland Geider3970d09669d2
diff --git a/docs/commands.rst b/docs/commands.rst
index f3028eaf6..2d7d2dcfb 100644
--- a/docs/commands.rst
+++ b/docs/commands.rst
@@ -105,6 +105,7 @@ Usage::
-e STRING, --extra-args=STRING Additional arguments to pass to the builtin server. Pass as string: "--arg1 --arg2=value". Default: none
-p, --port Port to use. Default: 8000
-s STRING, --settings-path=STRING Path to settings file. Leave empty for default
+ -t, --[no-]start-server Whether to start the development server. Default: true
Default locations
diff --git a/tasks.py b/tasks.py
index efe47c7c5..497d6c28c 100644
--- a/tasks.py
+++ b/tasks.py
@@ -62,8 +62,14 @@ def start_wger(address='localhost', port=8000, browser=False, settings_path=None
'database-path': 'Path to sqlite database (absolute path recommended). Leave empty for default',
'address': 'Address to use. Default: localhost',
'port': 'Port to use. Default: 8000',
- 'browser': 'Whether to open the application in a browser window. Default: false'})
-def bootstrap_wger(settings_path=None, database_path=None, address='localhost', port=8000, browser=False):
+ 'browser': 'Whether to open the application in a browser window. Default: false',
+ 'start-server': 'Whether to start the development server. Default: true'})
+def bootstrap_wger(settings_path=None,
+ database_path=None,
+ address='localhost',
+ port=8000,
+ browser=False,
+ start_server=True):
'''
Performs all steps necessary to bootstrap the application
'''
@@ -95,8 +101,9 @@ def bootstrap_wger(settings_path=None, database_path=None, address='localhost',
call_command('bower', 'install')
# Start the webserver
- print('*** Bootstraping complete, starting application')
- start_wger(address=address, port=port, browser=browser, settings_path=settings_path)
+ if start_server:
+ print('*** Bootstraping complete, starting application')
+ start_wger(address=address, port=port, browser=browser, settings_path=settings_path)
@task(help={'settings-path': 'Path to settings file (absolute path recommended). Leave empty for default',