Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Set a general wger instance from which to sync and download data

Roland Geider6a3250b948e0
diff --git a/wger/exercises/management/commands/download-exercise-images.py b/wger/exercises/management/commands/download-exercise-images.py
index 7fca7974c..dc44e1309 100644
--- a/wger/exercises/management/commands/download-exercise-images.py
+++ b/wger/exercises/management/commands/download-exercise-images.py
@@ -41,6 +41,7 @@ from wger.exercises.models import (
)
from wger.utils.requests import wger_headers
+
IMAGE_API = "{0}/api/v2/exerciseimage/"
@@ -66,9 +67,9 @@ class Command(BaseCommand):
'--remote-url',
action='store',
dest='remote_url',
- default='https://wger.de',
- help='Remote URL to fetch the exercises from (default: '
- 'https://wger.de)'
+ default=settings.WGER_SETTINGS['WGER_INSTANCE'],
+ help=f'Remote URL to fetch the images from (default: WGER_SETTINGS'
+ f'["WGER_INSTANCE"] - {settings.WGER_SETTINGS["WGER_INSTANCE"]})'
)
def handle(self, **options):
diff --git a/wger/exercises/management/commands/download-exercise-videos.py b/wger/exercises/management/commands/download-exercise-videos.py
index 790b2ad22..4f3d0dc24 100644
--- a/wger/exercises/management/commands/download-exercise-videos.py
+++ b/wger/exercises/management/commands/download-exercise-videos.py
@@ -41,6 +41,7 @@ from wger.exercises.models import (
)
from wger.utils.requests import wger_headers
+
VIDEO_API = "{0}/api/v2/video/"
diff --git a/wger/exercises/management/commands/sync-exercises.py b/wger/exercises/management/commands/sync-exercises.py
index 460720118..ceb530eca 100644
--- a/wger/exercises/management/commands/sync-exercises.py
+++ b/wger/exercises/management/commands/sync-exercises.py
@@ -13,6 +13,7 @@
# You should have received a copy of the GNU Affero General Public License
# Django
+from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.management.base import (
BaseCommand,
@@ -24,7 +25,6 @@ from django.core.validators import URLValidator
import requests
# wger
-from wger import get_version
from wger.core.models import Language
from wger.exercises.models import (
DeletionLog,
@@ -38,6 +38,7 @@ from wger.exercises.models import (
)
from wger.utils.requests import wger_headers
+
EXERCISE_API = "{0}/api/v2/exercisebaseinfo/?limit=100"
DELETION_LOG_API = "{0}/api/v2/deletion-log/?limit=100"
CATEGORY_API = "{0}/api/v2/exercisecategory/"
@@ -70,8 +71,9 @@ class Command(BaseCommand):
'--remote-url',
action='store',
dest='remote_url',
- default=self.remote_url,
- help=f'Remote URL to fetch the exercises from (default: {self.remote_url})'
+ default=settings.WGER_SETTINGS['WGER_INSTANCE'],
+ help=f'Remote URL to fetch the exercises from (default: WGER_SETTINGS'
+ f'["WGER_INSTANCE"] - {settings.WGER_SETTINGS["WGER_INSTANCE"]})'
)
parser.add_argument(
diff --git a/wger/settings_global.py b/wger/settings_global.py
index ef17c12b0..19ca7dd37 100644
--- a/wger/settings_global.py
+++ b/wger/settings_global.py
@@ -484,13 +484,15 @@ WGER_SETTINGS = {
'ALLOW_GUEST_USERS': True,
'ALLOW_REGISTRATION': True,
'ALLOW_UPLOAD_VIDEOS': False,
- 'USE_CELERY': False,
- 'DOWNLOAD_FROM_OFF': False,
- 'MIN_ACCOUNT_AGE_TO_TRUST': 21,
+ 'DOWNLOAD_INGREDIENT_IMAGES_FROM_OFF': False,
+ 'DOWNLOAD_INGREDIENT_IMAGES_FROM_WGER': True,
'EMAIL_FROM': 'wger Workout Manager <[email protected]>',
'EXERCISE_CACHE_TTL': 3600,
+ 'MIN_ACCOUNT_AGE_TO_TRUST': 21,
'TWITTER': False,
- 'USE_RECAPTCHA': False
+ 'USE_CELERY': False,
+ 'USE_RECAPTCHA': False,
+ 'WGER_INSTANCE': 'https://wger.de',
}