Skip to content

Commit cf36e8c

Browse files
author
Kenneth Reitz
committed
dj-database-url
1 parent 233df5d commit cf36e8c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/steps/django

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ if [ -f settings.py ]; then
1818
exit 1
1919
fi
2020

21-
echo "-----> Injecting Django settings..."
21+
echo "-----> Installing dj-database-url..."
22+
pip install --use-mirrors dj-database-url | indent
2223

24+
echo "-----> Injecting Django settings..."
2325

2426
SETTINGS_FILE=$(find . -maxdepth 2 -type f -name 'settings.py' | head -1)
2527
PROJECT=$(dirname $SETTINGS_FILE)
@@ -30,5 +32,9 @@ cat >>$SETTINGS_FILE <<EOF
3032
3133
import dj_database_url
3234
35+
if 'DATABASES' not in locals():
36+
DATABASES = {}
37+
38+
DATABASES = dj_database_url.config(DATABASES)
3339
EOF
3440

0 commit comments

Comments
 (0)