-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fixes #185] Bug: /bin/bash: line 1: django-admin.py: command not fou…
…nd (#187)
- Loading branch information
1 parent
c1291dc
commit d9cf4f3
Showing
1 changed file
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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, | ||
) | ||
|
@@ -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, | ||
) | ||
|
@@ -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): | ||
|
@@ -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, | ||
) | ||
|