Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-python
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-python
Commits
2a550b1a
Commit
2a550b1a
authored
Dec 07, 2011
by
Kenneth Reitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
subtle cleanups
parent
0512577a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
compile
bin/compile
+9
-6
No files found.
bin/compile
View file @
2a550b1a
...
@@ -90,18 +90,20 @@ if [ "$NAME" = "Python/Django" ]; then
...
@@ -90,18 +90,20 @@ if [ "$NAME" = "Python/Django" ]; then
cat
>>
$SETTINGS_FILE
<<
EOF
cat
>>
$SETTINGS_FILE
<<
EOF
import os, sys, urlparse
import os
import sys
import urlparse
urlparse.uses_netloc.append('postgres')
urlparse.uses_netloc.append('postgres')
urlparse.uses_netloc.append('mysql')
urlparse.uses_netloc.append('mysql')
try:
try:
#
check to make sure DATABASES is set in settings.py file.If not default to {}
#
Check to make sure DATABASES is set in settings.py file.
try:
# If not default to {}
DATABASES
except NameError
:
if 'DATABASES' not in locals()
:
DATABASES = {}
DATABASES = {}
if
os.environ.has_key('DATABASE_URL')
:
if
'DATABASE_URL' os.environ
:
url = urlparse.urlparse(os.environ['DATABASE_URL'])
url = urlparse.urlparse(os.environ['DATABASE_URL'])
# We use update here to preserve other keys we
# We use update here to preserve other keys we
...
@@ -115,6 +117,7 @@ try:
...
@@ -115,6 +117,7 @@ try:
})
})
if url.scheme == 'postgres':
if url.scheme == 'postgres':
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
if url.scheme == 'mysql':
if url.scheme == 'mysql':
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
except:
except:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment