From 20249f96725b4d6270b77d5acbf5a410a57ea3bc Mon Sep 17 00:00:00 2001
From: Kenneth Reitz <me@kennethreitz.com>
Date: Wed, 30 May 2012 02:50:50 -0400
Subject: [PATCH] MANAGE_FILE

---
 bin/release                    |  2 +-
 bin/steps/django/collectstatic | 10 ++++------
 bin/steps/django/init          |  4 +++-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/release b/bin/release
index 9fb30e16..9bc9a336 100755
--- a/bin/release
+++ b/bin/release
@@ -21,7 +21,7 @@ EOF
 
 [ "$NAME" = "Python/Django" ] || exit 0
 
-MANAGE_FILE=$(cd $BUILD_DIR && find . -maxdepth 2 -type f -name 'manage.py' | head -1)
+MANAGE_FILE=$(cd $BUILD_DIR && find . -maxdepth 3 -type f -name 'manage.py' | head -1)
 MANAGE_FILE=${MANAGE_FILE:2}
 PROJECT=$(dirname $MANAGE_FILE)
 
diff --git a/bin/steps/django/collectstatic b/bin/steps/django/collectstatic
index a5806f53..70dc3fb8 100755
--- a/bin/steps/django/collectstatic
+++ b/bin/steps/django/collectstatic
@@ -3,17 +3,17 @@
 set +e
 
 # Check if collectstatic is configured.
-python $PROJECT/manage.py collectstatic --help &> /dev/null && RUN_COLLECTSTATIC=true
+python $MANAGE_FILE collectstatic --help &> /dev/null && RUN_COLLECTSTATIC=true
 
 # Don't raise errors if SILENCE_COLLECTSTATIC is set.
 if [ ! "$SILENCE_COLLECTSTATIC" ]; then
     set -e
 fi
 
-# Compile assets if collectstatic appears to be .
+# Compile assets if collectstatic appears to be kosher.
 if [ "$RUN_COLLECTSTATIC" ]; then
     echo "-----> Collecting static files"
-    python $PROJECT/manage.py collectstatic --noinput --verbosity=0 | indent
+    python $MANAGE_FILE collectstatic --noinput --verbosity=0 | indent
 
     [ $? -ne 0 ] && {
         echo " !     Error running manage.py collectstatic. More info:"
@@ -22,6 +22,4 @@ if [ "$RUN_COLLECTSTATIC" ]; then
 else
     echo " !     Django collecstatic is not configured. Learn more:"
     echo "       http://devcenter.heroku.com/articles/django-assets"
-fi
-
-env
\ No newline at end of file
+fi
\ No newline at end of file
diff --git a/bin/steps/django/init b/bin/steps/django/init
index 82002633..bd40a397 100755
--- a/bin/steps/django/init
+++ b/bin/steps/django/init
@@ -2,13 +2,15 @@
 
 SETTINGS_FILE=$(find . -maxdepth 3 -type f -name 'settings.py' | head -1)
 PROJECT=$(dirname $SETTINGS_FILE)
+MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1)
+MANAGE_FILE=${MANAGE_FILE:2}
 
 # Disable injection for new applications.
 if [ -f .heroku/injection_disabled ]; then
   DISABLE_INJECTION=1
 fi
 
-export SETTINGS_FILE PROJECT DISABLE_INJECTION
+export SETTINGS_FILE MANAGE_FILE PROJECT DISABLE_INJECTION
 
 if [ ! "$DISABLE_INJECTION" ]; then
     source $BIN_DIR/steps/django/injection
-- 
GitLab