Compare commits

...

42 Commits

Author SHA1 Message Date
Kenneth Reitz 69bdca063f fix sub-env for when env file is not present 2013-12-20 17:15:24 -05:00
Kenneth Reitz 63cea99415 chmod +x 2013-12-20 16:48:34 -05:00
Kenneth Reitz 5ecd27e3b8 chmod +x 2013-12-13 16:03:39 -08:00
Kenneth Reitz 206a2dbc04 third argument support for envs in compile 2013-12-13 15:48:39 -08:00
kennethreitz 2a083791b6 Merge pull request #113 from zyegfryed/patch-3
Fixed Python runtime according to the official Heroku doc
2013-11-14 19:59:56 -08:00
kennethreitz d5b2b0b464 Merge pull request #114 from catsby/update_default_postgresql
Update Heroku Postgresql default add-on to hobby-dev
2013-11-14 19:59:40 -08:00
Clint Shryock 2eab1ad845 Update Heroku Postgresql default add-on to hobby-dev 2013-11-12 14:10:52 -06:00
Sébastien Fievet 2b16420d41 Fixed Python runtime according to the official Heroku doc
See https://devcenter.heroku.com/articles/python-runtimes#supported-runtimes
2013-11-04 09:24:36 +01:00
kennethreitz 9fa0889499 Update bpwatch 2013-10-17 15:43:51 -04:00
kennethreitz 99b17fabeb Merge pull request #105 from bacongobbler/patch-1
update shebang to use python2 for bpwatch
2013-10-17 11:37:00 -07:00
kennethreitz 933d3014d7 Merge pull request #103 from grosskur/library-path-fix
Make vendored libraries available at compile time (fixes #57)
2013-10-17 11:36:34 -07:00
Kenneth Reitz 018e0f31de Merge remote-tracking branch 'origin/master' 2013-09-01 06:27:46 +05:30
Kenneth Reitz cf1647e937 no --use-mirrors 2013-09-01 06:27:18 +05:30
Matthew Fisher b9f154bf38 update shebang to use python2 for bpwatch 2013-08-27 16:49:55 -07:00
Kenneth Reitz 4cc18ce0af Merge pull request #104 from zyegfryed/patch-1
Typo
2013-08-27 09:12:23 -07:00
Sébastien Fievet f5ea1c24a3 Typo 2013-08-25 18:41:46 +02:00
Kenneth Reitz 952b0bb735 v28 2013-08-14 22:02:11 -04:00
Kenneth Reitz 8b7edad8a2 bugfix for bpwatch 2013-08-14 22:01:16 -04:00
Kenneth Reitz 02787ac910 update bpwatch.zip for request_id 2013-08-14 21:19:12 -04:00
Alan Grosskurth bcc3ba09ca Make vendored libraries available at compile time (fixes #57)
When building, BUILD_DIR is set to a temporary directory. Vendored
libraries (e.g., pylibmc) are downloaded and unpacked in
$BUILD_DIR/.heroku/vendor/lib, but this is not currently in
LIBRARY_PATH or LD_LIBRARY_PATH.

Fix this by doing the following:

* Add $BUILD_DIR/.heroku/vendor/lib to LIBRARY_PATH/LD_LIBRARY_PATH

* Add $BUILD_DIR/.heroku/vendor/include to
  C_INCLUDE_PATH/CPLUS_INCLUDE_PATH

* Add $BUILD_DIR/.heroku/vendor/bin to PATH, so vendored commands can
  be used at compile time (e.g., curl-config)

* Add $BUILD_DIR/.heroku/vendor/lib/pkg-config to PKG_CONFIG_PATH, so
  vendored packages can be found with pkg-config
2013-08-14 16:59:31 -07:00
Kenneth Reitz 31e65dc58b new bpwatch 2013-07-17 17:04:37 -04:00
Kenneth Reitz 9a227e6c73 v24 2013-07-17 08:38:47 -04:00
Kenneth Reitz ddc9c24d34 deep-rm for normal builds 2013-07-17 08:34:14 -04:00
Kenneth Reitz 42488a2be7 deep-rm 2013-07-17 08:33:36 -04:00
Kenneth Reitz 839486c25b make things pretty, skip anvil build for normal runs 2013-07-17 08:25:17 -04:00
Kenneth Reitz 5d56200179 bugfix for legacy apps + usr_env_compile 2013-07-16 16:54:33 -04:00
Kenneth Reitz fef1d4f7c0 instrumentation 2013-07-16 15:10:49 -04:00
Kenneth Reitz 43defcc17e Revert "skip anvil steps that slow things down"
This reverts commit f78460e2a7.
2013-07-16 00:30:00 -04:00
Kenneth Reitz f78460e2a7 skip anvil steps that slow things down 2013-06-26 14:00:13 -04:00
Kenneth Reitz 3448923b69 collectstatic logic improvements 2013-06-26 13:58:00 -04:00
Kenneth Reitz 58a13bc268 Merge pull request #93 from bacongobbler/master
Add Django v1.5 testing support with Heroku
2013-06-05 13:09:42 -07:00
bacongobbler c18038f986 added Django v1.5 tests 2013-05-22 17:50:52 -07:00
bacongobbler d4356a1f4c added requirements.txt with django v1.5 2013-05-22 17:41:34 -07:00
bacongobbler 3c8f478b65 added django 1.5 skeleton for testing 2013-05-22 17:37:12 -07:00
Kenneth Reitz 23493302e6 Update Readme.md 2013-04-30 13:31:53 -03:00
Kenneth Reitz 35ceaf728d Merge pull request #90 from buildingenergy/master
Store changes made in post_compile in the cache.
2013-04-27 17:59:46 -07:00
Steven Skoczen 5c9412fc33 moves cache storage until after the post_compile hook. 2013-04-26 16:27:00 -07:00
Kenneth Reitz 825c9329eb Merge pull request #89 from gregburek/use-pg-dev-db
Remove shared db from release and add heroku-postgresql dev db
2013-04-23 23:53:21 -07:00
gregburek 9ebb990716 Remove shared db and add heroku-postgresql dev db 2013-04-23 23:50:54 -07:00
Kenneth Reitz f964209589 Merge remote-tracking branch 'origin/master' 2013-04-10 08:01:34 -07:00
Kenneth Reitz 2e699d392e Merge pull request #86 from manojlds/master
Fixing the compile hook scripts paths
2013-04-10 07:54:51 -07:00
manojlds 431ecee509 Using the bin path at root of pwd
The compile script is run with the root of the git repo of the project
being pushed as the working directory.

$BIN_DIR is pointing to the bin directory of the buildpack which is not
where you would want to put the pre and post compile hooks.

Changing back to the old convention of looking for the hooks from the
bin directory at the root of the project.
2013-04-10 15:06:51 +05:30
16 changed files with 382 additions and 62 deletions
+3 -3
View File
@@ -45,10 +45,10 @@ Specify a Runtime
You can also provide arbitrary releases Python with a `runtime.txt` file. You can also provide arbitrary releases Python with a `runtime.txt` file.
$ cat runtime.txt $ cat runtime.txt
python-3.3.0 python-3.3.2
Runtime options include: Runtime options include:
- python-2.7.3 - python-2.7.4
- python-3.3.0 - python-3.3.2
- pypy-1.9 (experimental) - pypy-1.9 (experimental)
+118 -46
View File
@@ -2,8 +2,7 @@
# Usage: # Usage:
# #
# $ bin/compile <build-dir> <cache-dir> # $ bin/compile <build-dir> <cache-dir> <env-path>
# Fail fast and fail hard. # Fail fast and fail hard.
set -eo pipefail set -eo pipefail
@@ -16,6 +15,8 @@ BIN_DIR=$(cd $(dirname $0); pwd) # absolute path
ROOT_DIR=$(dirname $BIN_DIR) ROOT_DIR=$(dirname $BIN_DIR)
BUILD_DIR=$1 BUILD_DIR=$1
CACHE_DIR=$2 CACHE_DIR=$2
ENV_FILE=$3
CACHED_DIRS=".heroku" CACHED_DIRS=".heroku"
@@ -30,9 +31,25 @@ PYTHON_EXE="/app/.heroku/python/bin/python"
PIP_VERSION="1.3.1" PIP_VERSION="1.3.1"
DISTRIBUTE_VERSION="0.6.36" DISTRIBUTE_VERSION="0.6.36"
# Setup bpwatch
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
LOGPLEX_KEY="t.b396af7f-ad75-4643-8b9e-ebb288acc624"
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
BUILDPACK_VERSION=v28
# Support Anvil Build_IDs
[ ! "$REQUEST_ID" ] && REQUEST_ID=$SLUG_ID
# Sanitizing environment variables. # Sanitizing environment variables.
unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH unset GIT_DIR PYTHONHOME PYTHONPATH LD_LIBRARY_PATH LIBRARY_PATH
bpwatch init $LOGPLEX_KEY
bpwatch build python $BUILDPACK_VERSION $REQUEST_ID
TMP_APP_DIR=$CACHE_DIR/tmp_app_dir
bpwatch start compile
# We'll need to send these statics to other scripts we `source`. # We'll need to send these statics to other scripts we `source`.
export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
@@ -44,28 +61,41 @@ APP_DIR='/app'
TMP_APP_DIR=$CACHE_DIR/tmp_app_dir TMP_APP_DIR=$CACHE_DIR/tmp_app_dir
# Copy Anvil app dir to temporary storage... # Copy Anvil app dir to temporary storage...
mkdir -p $TMP_APP_DIR bpwatch start anvil_appdir_stage
deep-mv $APP_DIR $TMP_APP_DIR if [ "$SLUG_ID" ]; then
mkdir -p $TMP_APP_DIR
deep-mv $APP_DIR $TMP_APP_DIR
else
deep-rm $APP_DIR
fi
bpwatch stop anvil_appdir_stage
# Copy Application code in. # Copy Application code in.
deep-mv $BUILD_DIR $APP_DIR bpwatch start appdir_stage
deep-mv $BUILD_DIR $APP_DIR
bpwatch stop appdir_stage
# Set new context. # Set new context.
ORIG_BUILD_DIR=$BUILD_DIR ORIG_BUILD_DIR=$BUILD_DIR
BUILD_DIR=$APP_DIR BUILD_DIR=$APP_DIR
# Prepend proper path buildpack use. # Prepend proper path buildpack use.
export PATH=$BUILD_DIR/.heroku/python/bin:$PATH export PATH=$BUILD_DIR/.heroku/python/bin:$BUILD_DIR/.heroku/vendor/bin:$PATH
export PYTHONUNBUFFERED=1 export PYTHONUNBUFFERED=1
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
export LIBRARY_PATH=/app/.heroku/vendor/lib export C_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include
export LD_LIBRARY_PATH=/app/.heroku/vendor/lib export CPLUS_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include
export LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.heroku/vendor/lib
export LD_LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.heroku/vendor/lib
export PKG_CONFIG_PATH=/app/.heroku/vendor/lib/pkg-config:$BUILD_DIR/.heroku/vendor/lib/pkg-config
# Switch to the repo's context. # Switch to the repo's context.
cd $BUILD_DIR cd $BUILD_DIR
# Experimental pre_compile hook. # Experimental pre_compile hook.
source $BIN_DIR/steps/hooks/pre_compile bpwatch start pre_compile
source $BIN_DIR/steps/hooks/pre_compile
bpwatch stop pre_compile
# If no requirements given, assume `setup.py develop`. # If no requirements given, assume `setup.py develop`.
if [ ! -f requirements.txt ]; then if [ ! -f requirements.txt ]; then
@@ -83,13 +113,17 @@ fi
mkdir -p $CACHE_DIR mkdir -p $CACHE_DIR
# Purge "old-style" virtualenvs. # Purge "old-style" virtualenvs.
[ -d $CACHE_DIR/$LEGACY_TRIGGER ] && rm -fr $CACHE_DIR/.heroku/bin $CACHE_DIR/.heroku/lib $CACHE_DIR/.heroku/include bpwatch start clear_old_venvs
[ -d $CACHE_DIR/$VIRTUALENV_LOC ] && rm -fr $CACHE_DIR/.heroku/venv $CACHE_DIR/.heroku/src [ -d $CACHE_DIR/$LEGACY_TRIGGER ] && rm -fr $CACHE_DIR/.heroku/bin $CACHE_DIR/.heroku/lib $CACHE_DIR/.heroku/include
[ -d $CACHE_DIR/$VIRTUALENV_LOC ] && rm -fr $CACHE_DIR/.heroku/venv $CACHE_DIR/.heroku/src
bpwatch stop clear_old_venvs
# Restore old artifacts from the cache. # Restore old artifacts from the cache.
for dir in $CACHED_DIRS; do bpwatch start restore_cache
cp -R $CACHE_DIR/$dir . &> /dev/null || true for dir in $CACHED_DIRS; do
done cp -R $CACHE_DIR/$dir . &> /dev/null || true
done
bpwatch stop restore_cache
set +e set +e
# Create set-aside `.heroku` folder. # Create set-aside `.heroku` folder.
@@ -104,8 +138,10 @@ PYTHON_VERSION=$(cat runtime.txt)
# Install Python. # Install Python.
if [ -f .heroku/python-version ]; then if [ -f .heroku/python-version ]; then
if [ ! $(cat .heroku/python-version) = $PYTHON_VERSION ]; then if [ ! $(cat .heroku/python-version) = $PYTHON_VERSION ]; then
puts-step "Found $(cat .heroku/python-version), removing." bpwatch start uninstall_python
rm -fr .heroku/python puts-step "Found $(cat .heroku/python-version), removing."
rm -fr .heroku/python
bpwatch stop uninstall_python
else else
SKIP_INSTALL=1 SKIP_INSTALL=1
fi fi
@@ -113,14 +149,16 @@ fi
if [ ! "$SKIP_INSTALL" ]; then if [ ! "$SKIP_INSTALL" ]; then
puts-step "Preparing Python runtime ($PYTHON_VERSION)" bpwatch start install_python
curl http://envy-versions.s3.amazonaws.com/$PYTHON_VERSION.tar.bz2 -s | tar jx &> /dev/null puts-step "Preparing Python runtime ($PYTHON_VERSION)"
if [[ $? != 0 ]] ; then curl http://envy-versions.s3.amazonaws.com/$PYTHON_VERSION.tar.bz2 -s | tar jx &> /dev/null
puts-warn "Requested runtime ($PYTHON_VERSION) was not found." if [[ $? != 0 ]] ; then
puts-warn "Aborting. More info: https://devcenter.heroku.com/articles/python-support" puts-warn "Requested runtime ($PYTHON_VERSION) was not found."
exit 1 puts-warn "Aborting. More info: https://devcenter.heroku.com/articles/python-support"
fi exit 1
mv python .heroku/python fi
mv python .heroku/python
bpwatch stop install_python
# Record for future reference. # Record for future reference.
echo $PYTHON_VERSION > .heroku/python-version echo $PYTHON_VERSION > .heroku/python-version
@@ -135,16 +173,24 @@ fi
if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then
WORKING_DIR=$(pwd) WORKING_DIR=$(pwd)
# Prepare it for the real world bpwatch start prepare_environment
puts-step "Installing Distribute ($DISTRIBUTE_VERSION)"
cd $ROOT_DIR/vendor/distribute-$DISTRIBUTE_VERSION/
python setup.py install &> /dev/null
cd $WORKING_DIR
puts-step "Installing Pip ($PIP_VERSION)" bpwatch start install_distribute
cd $ROOT_DIR/vendor/pip-$PIP_VERSION/ # Prepare it for the real world
python setup.py install &> /dev/null puts-step "Installing Distribute ($DISTRIBUTE_VERSION)"
cd $WORKING_DIR cd $ROOT_DIR/vendor/distribute-$DISTRIBUTE_VERSION/
python setup.py install &> /dev/null
cd $WORKING_DIR
bpwatch stop install_distribute
bpwatch start install_pip
puts-step "Installing Pip ($PIP_VERSION)"
cd $ROOT_DIR/vendor/pip-$PIP_VERSION/
python setup.py install &> /dev/null
cd $WORKING_DIR
bpwatch stop install_pip
bpwatch stop prepare_environment
fi fi
set -e set -e
@@ -152,29 +198,37 @@ hash -r
# Pylibmc support. # Pylibmc support.
# See [`bin/steps/pylibmc`](pylibmc.html). # See [`bin/steps/pylibmc`](pylibmc.html).
source $BIN_DIR/steps/pylibmc bpwatch start pylibmc_install
source $BIN_DIR/steps/pylibmc
bpwatch stop pylibmc_install
# Install Mercurial if it appears to be required. # Install Mercurial if it appears to be required.
if (grep -Fiq "hg+" requirements.txt) then if (grep -Fiq "hg+" requirements.txt) then
/app/.heroku/python/bin/pip install --use-mirrors mercurial | cleanup | indent bpwatch start mercurial_install
/app/.heroku/python/bin/pip install mercurial | cleanup | indent
bpwatch stop mercurial_install
fi fi
# Install dependencies with Pip. # Install dependencies with Pip.
puts-step "Installing dependencies using Pip ($PIP_VERSION)" puts-step "Installing dependencies using Pip ($PIP_VERSION)"
/app/.heroku/python/bin/pip install --use-mirrors -r requirements.txt --exists-action=w --src=./.heroku/src | cleanup | indent
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
/app/.heroku/python/bin/pip install -r requirements.txt --exists-action=w --src=./.heroku/src | cleanup | indent
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
# Django collectstatic support. # Django collectstatic support.
source $BIN_DIR/steps/collectstatic bpwatch start collectstatic
sub-env $BIN_DIR/steps/collectstatic
bpwatch stop collectstatic
# ### Finalize # ### Finalize
# #
# Store new artifacts in cache.
for dir in $CACHED_DIRS; do
rm -rf $CACHE_DIR/$dir
cp -R $dir $CACHE_DIR/
done
# Set context environment variables. # Set context environment variables.
set-env PATH '$HOME/.heroku/python/bin:$PATH' set-env PATH '$HOME/.heroku/python/bin:$PATH'
set-env PYTHONUNBUFFERED true set-env PYTHONUNBUFFERED true
@@ -187,9 +241,27 @@ set-default-env PYTHONPATH /app/
# Experimental post_compile hook. # Experimental post_compile hook.
source $BIN_DIR/steps/hooks/post_compile bpwatch start post_compile
source $BIN_DIR/steps/hooks/post_compile
bpwatch stop post_compile
# Store new artifacts in cache.
bpwatch start dump_cache
for dir in $CACHED_DIRS; do
rm -rf $CACHE_DIR/$dir
cp -R $dir $CACHE_DIR/
done
bpwatch stop dump_cache
# ### Fin. # ### Fin.
bpwatch start appdir_commit
deep-mv $BUILD_DIR $ORIG_BUILD_DIR
bpwatch stop appdir_commit
deep-mv $BUILD_DIR $ORIG_BUILD_DIR bpwatch start anvil_appdir_commit
deep-mv $TMP_APP_DIR $APP_DIR if [ "$SLUG_ID" ]; then
deep-mv $TMP_APP_DIR $APP_DIR
fi
bpwatch stop anvil_appdir_commit
bpwatch stop compile
+2 -2
View File
@@ -18,6 +18,6 @@ if [[ $MANAGE_FILE ]]; then
cat <<EOF cat <<EOF
addons: addons:
shared-database:5mb heroku-postgresql:hobby-dev
EOF EOF
fi fi
Regular → Executable
+3 -5
View File
@@ -7,13 +7,11 @@ indent() {
} }
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1) MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1)
MANAGE_FILE=${MANAGE_FILE:2} MANAGE_FILE=${MANAGE_FILE:-fakepath}
if [ -f .heroku/collectstatic_disabled ]; then [ -f .heroku/collectstatic_disabled ] && DISABLE_COLLECTSTATIC=1
DISABLE_COLLECTSTATIC=1
fi
if [ ! "$DISABLE_COLLECTSTATIC" ]; then if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ]; then
set +e set +e
# Check if collectstatic is configured properly. # Check if collectstatic is configured properly.
Regular → Executable
+3 -3
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ -f $BIN_DIR/post_compile ]; then if [ -f bin/post_compile ]; then
echo "-----> Running post-compile hook" echo "-----> Running post-compile hook"
chmod +x $BIN_DIR/post_compile chmod +x bin/post_compile
$BIN_DIR/post_compile sub-env bin/post_compile
fi fi
Regular → Executable
+3 -3
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ -f $BIN_DIR/pre_compile ]; then if [ -f bin/pre_compile ]; then
echo "-----> Running pre-compile hook" echo "-----> Running pre-compile hook"
chmod +x $BIN_DIR/pre_compile chmod +x bin/pre_compile
$BIN_DIR/pre_compile sub-env bin/pre_compile
fi fi
+6
View File
@@ -20,6 +20,12 @@ testDetectWithEmptyReqs() {
assertCapturedSuccess assertCapturedSuccess
} }
testDetectDjango15() {
detect "django-1.5-skeleton"
assertCapturedEquals "Python"
assertCapturedSuccess
}
testDetectDjango14() { testDetectDjango14() {
detect "django-1.4-skeleton" detect "django-1.4-skeleton"
assertCapturedEquals "Python" assertCapturedEquals "Python"
+14
View File
@@ -52,3 +52,17 @@ function deep-mv (){
rm -fr $1/!(tmp) rm -fr $1/!(tmp)
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \; find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
} }
# Does some serious deleting.
function deep-rm (){
rm -fr $1/!(tmp)
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
}
function sub-env (){
if [[ -f $ENV_FILE ]]; then
(export $(egrep -v '^(GIT_DIR|PYTHONHOME|PYTHONPATH|LD_LIBRARY_PATH|LIBRARY_PATH|PATH)' -f $ENV_FILE); $1)
else
$1
fi
}
@@ -0,0 +1,156 @@
# Django settings for haystack project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
}
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = '@w-1$9#jh05!qvbh#1k)c4=w9llcq116f$5(4&s_c)n4@%n=pc'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'haystack.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'haystack.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
+17
View File
@@ -0,0 +1,17 @@
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'haystack.views.home', name='home'),
# url(r'^haystack/', include('haystack.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)
+32
View File
@@ -0,0 +1,32 @@
"""
WSGI config for haystack project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "haystack.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "haystack.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "haystack.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
@@ -0,0 +1 @@
django==1.5
Vendored Executable
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env python2
import os
import sys
DEFAULT_PATH = '{0}.zip'.format(os.path.abspath(__file__))
BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFAULT_PATH)
sys.path.insert(0, BPWATCH_DISTRO_PATH)
import bp_cli
bp_cli.main()
BIN
View File
Binary file not shown.