Skip to content

Commit

Permalink
[Fixes #185] Bug: /bin/bash: line 1: django-admin.py: command not fou…
Browse files Browse the repository at this point in the history
…nd (#187)
  • Loading branch information
mwallschlaeger authored Jun 29, 2024
1 parent c1291dc commit d9cf4f3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions charts/geonode/templates/geonode/geonode-tasks-py-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,18 @@ data:
except Exception:
pass
@task
def statics(ctx):
print("**************************statics*******************************")
try:
ctx.run("mkdir -p /mnt/volumes/statics/{static,uploads}")
ctx.run(f"python manage.py collectstatic --noinput --settings={_localsettings()}", pty=True)
static_root = os.environ.get("STATIC_ROOT", "/mnt/volumes/statics/static/")
media_root = os.environ.get("MEDIA_ROOT", "/mnt/volumes/statics/uploaded/")
ctx.run(f"mkdir -pv {static_root} {media_root}")
ctx.run(
f"python manage.py collectstatic --noinput --settings={_localsettings()}",
pty=True,
)
except Exception:
import traceback
Expand Down Expand Up @@ -357,7 +362,7 @@ data:
def collectstatic(ctx):
print("************************static artifacts******************************")
ctx.run(
f"django-admin.py collectstatic --noinput \
f"django-admin collectstatic --noinput \
--settings={_localsettings()}",
pty=True,
)
Expand All @@ -374,7 +379,7 @@ data:
_prepare_monitoring_fixture()
try:
ctx.run(
f"django-admin.py loaddata /tmp/default_monitoring_apps_docker.json \
f"django-admin loaddata /tmp/default_monitoring_apps_docker.json \
--settings={_localsettings()}",
pty=True,
)
Expand All @@ -385,7 +390,7 @@ data:
def updategeoip(ctx):
print("**************************update geoip*******************************")
if ast.literal_eval(os.environ.get("MONITORING_ENABLED", "False")):
ctx.run(f"django-admin.py updategeoip --settings={_localsettings()}", pty=True)
ctx.run(f"django-admin updategeoip --settings={_localsettings()}", pty=True)
@task
def updateadmin(ctx):
Expand All @@ -395,7 +400,7 @@ data:
os.environ.get("ADMIN_PASSWORD", "admin"), os.environ.get("ADMIN_EMAIL", "[email protected]")
)
ctx.run(
f"django-admin.py loaddata /tmp/django_admin_docker.json \
f"django-admin loaddata /tmp/django_admin_docker.json \
--settings={_localsettings()}",
pty=True,
)
Expand Down

0 comments on commit d9cf4f3

Please sign in to comment.