Skip to content
Snippets Groups Projects
Commit bea5b491 authored by Andrés Torres's avatar Andrés Torres
Browse files

Added support for django 1.4

parent b67a0404
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash #!/usr/bin/env bash
# This script serves as the # This script serves as the
# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) # [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python)
# detector. # detector.
# #
# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an # A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an
# adapter between a Python application and Heroku's runtime. # adapter between a Python application and Heroku's runtime.
# ## Usage # ## Usage
# Compiling an app into a slug is simple: # Compiling an app into a slug is simple:
# #
# $ bin/detect <build-dir> <cache-dir> # $ bin/detect <build-dir> <cache-dir>
BUILD_DIR=$1 BUILD_DIR=$1
...@@ -25,9 +25,10 @@ if [ ! -f $BUILD_DIR/requirements.txt ]; then ...@@ -25,9 +25,10 @@ if [ ! -f $BUILD_DIR/requirements.txt ]; then
exit 0 exit 0
fi 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`. # `requirements.txt`.
# #
# Otherwise, `Python`. # 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 [ -n "$SETTINGS_FILE" ] && (grep -Fiq "django" $BUILD_DIR/requirements.txt) && echo Python/Django || echo Python
\ No newline at end of file \ No newline at end of file
#!/usr/bin/env bash #!/usr/bin/env bash
# This script serves as the Django build step of the # This script serves as the Django build step of the
# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) # [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python)
# compiler. # compiler.
# #
# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an # A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an
# adapter between a Python application and Heroku's runtime. # adapter between a Python application and Heroku's runtime.
# #
# This script is invoked by [`bin/compile`](/). # This script is invoked by [`bin/compile`](/).
...@@ -21,7 +21,7 @@ fi ...@@ -21,7 +21,7 @@ fi
echo "-----> Injecting Django settings..." 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) PROJECT=$(dirname $SETTINGS_FILE)
echo "Injecting code into $SETTINGS_FILE to read from DATABASE_URL" | indent echo "Injecting code into $SETTINGS_FILE to read from DATABASE_URL" | indent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment