diff --git a/bin/detect b/bin/detect index e14b3808682fd9ed778898bc7c19c9c17180f122..b41a49865fd3465cec8163afbdeb9942bfa28bf3 100755 --- a/bin/detect +++ b/bin/detect @@ -1,15 +1,15 @@ #!/usr/bin/env bash -# This script serves as the -# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) -# detector. -# -# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an +# This script serves as the +# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) +# detector. +# +# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an # adapter between a Python application and Heroku's runtime. # ## Usage # Compiling an app into a slug is simple: -# +# # $ bin/detect <build-dir> <cache-dir> BUILD_DIR=$1 @@ -25,9 +25,10 @@ if [ ! -f $BUILD_DIR/requirements.txt ]; then exit 0 fi -# `Python/Django` if `**/settings.py` is present and `django` exists in +# `Python/Django` if `**/settings.py` is present and `django` exists in # `requirements.txt`. # # Otherwise, `Python`. +SETTINGS_FILE=$(find $BUILD_DIR/. -maxdepth 3 -type f -name 'settings.py' | head -1) -ls $BUILD_DIR/**/settings.py &> /dev/null && (grep -Fiq "django" $BUILD_DIR/requirements.txt) && echo Python/Django || echo Python \ No newline at end of file +[ -n "$SETTINGS_FILE" ] && (grep -Fiq "django" $BUILD_DIR/requirements.txt) && echo Python/Django || echo Python \ No newline at end of file diff --git a/bin/steps/django b/bin/steps/django index c00ba58e04b8ff6b3402c5c244906a0e4c836de5..12aadb4fecafe78cf2efd5c975dcf5ddc9652ebe 100755 --- a/bin/steps/django +++ b/bin/steps/django @@ -1,10 +1,10 @@ #!/usr/bin/env bash # This script serves as the Django build step of the -# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) -# compiler. -# -# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an +# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) +# compiler. +# +# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an # adapter between a Python application and Heroku's runtime. # # This script is invoked by [`bin/compile`](/). @@ -21,7 +21,7 @@ fi echo "-----> Injecting Django settings..." -SETTINGS_FILE=$(find . -maxdepth 2 -type f -name 'settings.py' | head -1) +SETTINGS_FILE=$(find . -maxdepth 3 -type f -name 'settings.py' | head -1) PROJECT=$(dirname $SETTINGS_FILE) echo "Injecting code into $SETTINGS_FILE to read from DATABASE_URL" | indent diff --git a/test/django-1.4-skeleton/haystack/__init__.py b/test/django-1.4-skeleton/haystack/haystack/__init__.py similarity index 100% rename from test/django-1.4-skeleton/haystack/__init__.py rename to test/django-1.4-skeleton/haystack/haystack/__init__.py diff --git a/test/django-1.4-skeleton/haystack/settings.py b/test/django-1.4-skeleton/haystack/haystack/settings.py similarity index 100% rename from test/django-1.4-skeleton/haystack/settings.py rename to test/django-1.4-skeleton/haystack/haystack/settings.py diff --git a/test/django-1.4-skeleton/haystack/urls.py b/test/django-1.4-skeleton/haystack/haystack/urls.py similarity index 100% rename from test/django-1.4-skeleton/haystack/urls.py rename to test/django-1.4-skeleton/haystack/haystack/urls.py diff --git a/test/django-1.4-skeleton/haystack/wsgi.py b/test/django-1.4-skeleton/haystack/haystack/wsgi.py similarity index 100% rename from test/django-1.4-skeleton/haystack/wsgi.py rename to test/django-1.4-skeleton/haystack/haystack/wsgi.py diff --git a/test/django-1.4-skeleton/manage.py b/test/django-1.4-skeleton/haystack/manage.py similarity index 100% rename from test/django-1.4-skeleton/manage.py rename to test/django-1.4-skeleton/haystack/manage.py