Self hosted FLOSS fitness/workout, nutrition and weight tracker
Pass settings_path to all tasks when bootstraping
Roland Geiderd827ce6a0e30
diff --git a/tasks.py b/tasks.pyindex 608a123f1..1985a73cb 100644--- a/tasks.py+++ b/tasks.py@@ -57,14 +57,11 @@ def start_wger(address='localhost', port=8000, browser=False, settings_path=None@task-def bootstrap_wger(settings_path=None, address='localhost', port=8000, browser=False, upgrade_db=False, reset_admin=False):+def bootstrap_wger(settings_path=None, database_path=None, address='localhost', port=8000, browser=False, upgrade_db=False, reset_admin=False):'''Performs all steps necessary to bootstrap the application'''- # Find the path to the settings and setup the django environment- setup_django_environment(settings_path)-# Find url to wgeraddress, port = detect_listen_opts(address, port)if port == 80:@@ -74,14 +71,17 @@ def bootstrap_wger(settings_path=None, address='localhost', port=8000, browser=F# Create settings if necessaryif settings_path and not os.path.exists(settings_path):- create_settings(settings_path, url=url)+ create_settings(settings_path=settings_path, database_path=database_path, url=url)++ # Find the path to the settings and setup the django environment+ setup_django_environment(settings_path)# Create Database if necessaryif not database_exists() or upgrade_db:print('*** Database does not exist, creating one now')- migrate_db()- load_fixtures()- create_or_reset_admin()+ migrate_db(settings_path=settings_path)+ load_fixtures(settings_path=settings_path)+ create_or_reset_admin(settings_path=settings_path)# Only run the south migrationselif upgrade_db:@@ -91,7 +91,7 @@ def bootstrap_wger(settings_path=None, address='localhost', port=8000, browser=Felif reset_admin:create_or_reset_admin()- start_wger(address=address, port=port, browser=browser)+ start_wger(address=address, port=port, browser=browser, settings_path=settings_path)@task