aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDanilo Šegan <danilo@segan.org>2012-08-13 09:02:53 +0200
committerDanilo Šegan <danilo@segan.org>2012-08-13 09:02:53 +0200
commite3ed846e531cd889661414dd2f06c435cdd09879 (patch)
tree91335c2395a4c61dcdb8dfb8471300be02d319a3 /scripts
parentd39083f117a4736fcbc683144dca0a6bbe73d51d (diff)
Set the PYTHONPATH and use django-admin instead of manage.py.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-staging.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/update-staging.py b/scripts/update-staging.py
index 56aa8ac..dcf21f3 100755
--- a/scripts/update-staging.py
+++ b/scripts/update-staging.py
@@ -43,16 +43,26 @@ if __name__ == '__main__':
refresh_branch(code_root)
refresh_branch(configs_root)
+ os.environ.setdefault(
+ "PYTHONPATH",
+ ":".join(
+ [os.path.dirname(code_root),
+ code_root,
+ os.path.join(configs_root, "django"),
+ os.environ.get("PYTHONPATH", "")]))
+
# For all configs we've got, do a 'syncdb' and 'collectstatic' steps.
for config in configs_to_use:
logger.info("Updating installation with config %s...", config)
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", config)
+ os.environ["DJANGO_SETTINGS_MODULE"] = config
+ logger.debug("DJANGO_SETTINGS_MODULE=%s",
+ os.environ.get("DJANGO_SETTINGS_MODULE"))
logger.debug("Doing 'syncdb'...")
logger.debug(subprocess.check_output(
- ["python", "manage.py", "syncdb", "--noinput"], cwd=code_root))
+ ["django-admin", "syncdb", "--noinput"], cwd=code_root))
# At this time we could only be doing a single 'collectstatic' step,
# but our configs might change.
logger.debug("Doing 'collectstatic'...")
logger.debug(subprocess.check_output(
- ["python", "manage.py", "collectstatic", "--noinput"],
+ ["django-admin", "collectstatic", "--noinput"],
cwd=code_root))