mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
updating to have pip conf and cleaning up exception
This commit is contained in:
+9
-3
@@ -33,6 +33,13 @@ done
|
||||
echo "-----> Preparing virtualenv version $(virtualenv --version)"
|
||||
virtualenv --no-site-packages . | sed -u 's/^/ /'
|
||||
|
||||
mkdir .pip
|
||||
cat >>.pip/pip.conf <<EOF
|
||||
[install]
|
||||
use-mirrors = true
|
||||
|
||||
EOF
|
||||
|
||||
#echo "-----> Byte-compiling code"
|
||||
find . -name "*.py" | grep -v bin/manage.py | xargs bin/python -m py_compile
|
||||
|
||||
@@ -59,13 +66,12 @@ try:
|
||||
'HOST': url.hostname,
|
||||
'PORT': url.port,
|
||||
}
|
||||
if 'postgres' in os.environ['DATABASE_URL']:
|
||||
if url.scheme == 'postgres':
|
||||
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2',
|
||||
if 'mysql' in os.environ['DATABASE_URL']:
|
||||
if url.scheme == 'mysql':
|
||||
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql',
|
||||
except:
|
||||
print "Unexpected error:", sys.exc_info()
|
||||
raise
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user