From bea5b4919e9486aa535cccbd599def640b0e53ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Torres?= <andres.torres.marroquin@gmail.com> Date: Tue, 3 Apr 2012 11:14:39 -0500 Subject: [PATCH] Added support for django 1.4 --- bin/detect | 17 +++++++++-------- bin/steps/django | 10 +++++----- .../haystack/{ => haystack}/__init__.py | 0 .../haystack/{ => haystack}/settings.py | 0 .../haystack/{ => haystack}/urls.py | 0 .../haystack/{ => haystack}/wsgi.py | 0 .../{ => haystack}/manage.py | 0 7 files changed, 14 insertions(+), 13 deletions(-) rename test/django-1.4-skeleton/haystack/{ => haystack}/__init__.py (100%) rename test/django-1.4-skeleton/haystack/{ => haystack}/settings.py (100%) rename test/django-1.4-skeleton/haystack/{ => haystack}/urls.py (100%) rename test/django-1.4-skeleton/haystack/{ => haystack}/wsgi.py (100%) rename test/django-1.4-skeleton/{ => haystack}/manage.py (100%) diff --git a/bin/detect b/bin/detect index e14b3808..b41a4986 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 c00ba58e..12aadb4f 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 -- GitLab