Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes #185] Bug: /bin/bash: line 1: django-admin.py: command not found #187

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading