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
12f053ef
Commit
12f053ef
authored
Dec 06, 2012
by
Kenneth Reitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove almost all django support
parent
35ee2f60
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
146 deletions
+41
-146
compile
bin/compile
+1
-1
detect
bin/detect
+3
-38
django
bin/steps/django
+37
-0
collectstatic
bin/steps/django/collectstatic
+0
-28
init
bin/steps/django/init
+0
-32
injection
bin/steps/django/injection
+0
-47
No files found.
bin/compile
View file @
12f053ef
...
@@ -159,7 +159,7 @@ pip install --use-mirrors -r requirements.txt --exists-action=w --src=./.heroku/
...
@@ -159,7 +159,7 @@ pip install --use-mirrors -r requirements.txt --exists-action=w --src=./.heroku/
# See [`bin/steps/django`](django.html).
# See [`bin/steps/django`](django.html).
if
[
"
$NAME
"
=
"Python/Django"
]
;
then
if
[
"
$NAME
"
=
"Python/Django"
]
;
then
source
$BIN_DIR
/steps/django
/init
source
$BIN_DIR
/steps/django
fi
fi
# Make Virtualenv's paths relative for portability.
# Make Virtualenv's paths relative for portability.
...
...
bin/detect
View file @
12f053ef
...
@@ -19,46 +19,11 @@ if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ]; then
...
@@ -19,46 +19,11 @@ if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ]; then
exit
1
exit
1
fi
fi
# If only `setup.py`, assume that the app is not Django.
# `Python/Django` if `**/settings.py` is present.
if
[
!
-f
$BUILD_DIR
/requirements.txt
]
;
then
echo
Python
exit
0
fi
# `Python/Django` if `**/settings.py` is present and `django` exists in
# `requirements.txt`.
#
#
# Otherwise, `Python`.
# Otherwise, `Python`.
array
=
""
list_requirements
()
{
IFS_BAK
=
$IFS
IFS
=
"
"
requirement_file
=
$1
reqs
=
$(
cat
$requirement_file
)
for
req
in
$reqs
;
do
if
[[
$req
==
-r
*
]]
;
then
new_req
=
$(
echo
$req
|
cut
-d
" "
-f2
)
if
[[
$new_req
==
$1
]]
;
then
continue
fi
directory
=
$(
dirname
$requirement_file
)
if
[[
!
$array
==
*
$directory
/
$new_req
*
]]
;
then
list_requirements
"
$directory
/
$new_req
"
fi
array
=
"
$array
$directory
/
$new_req
"
else
echo
$req
;
fi
done
IFS
=
$IFS_BAK
IFS_BAK
=
}
SETTINGS_FILE
=
$(
find
$BUILD_DIR
/.
-maxdepth
2
-type
f
-name
'settings.py'
|
head
-1
)
SETTINGS_FILE
=
$(
find
$BUILD_DIR
/.
-maxdepth
3
-type
f
-name
'settings.py'
|
head
-1
)
[
-n
"
$SETTINGS_FILE
"
]
&&
(
list_requirements
$BUILD_DIR
/requirements.txt |
grep
-Fiq
"django"
)
&&
echo
Python/Django
||
echo
Python
[
-n
"
$SETTINGS_FILE
"
]
&&
echo
Python/Django
||
echo
Python
bin/steps/django
0 → 100644
View file @
12f053ef
#!/usr/bin/env bash
# Syntax sugar.
indent
()
{
RE
=
"s/^/ /"
[
$(
uname
)
==
"Darwin"
]
&&
sed
-l
"
$RE
"
||
sed
-u
"
$RE
"
}
SETTINGS_FILE
=
$(
find
.
-maxdepth
3
-type
f
-name
'settings.py'
|
head
-1
)
PROJECT
=
$(
dirname
$SETTINGS_FILE
)
MANAGE_FILE
=
$(
find
.
-maxdepth
3
-type
f
-name
'manage.py'
|
head
-1
)
MANAGE_FILE
=
${
MANAGE_FILE
:2
}
if
[
!
"
$DISABLE_COLLECTSTATIC
"
]
;
then
set
+e
# Check if collectstatic is configured properly.
python
$MANAGE_FILE
collectstatic
--dry-run
--noinput
&> /dev/null
&&
RUN_COLLECTSTATIC
=
true
# Compile assets if collectstatic appears to be kosher.
if
[
"
$RUN_COLLECTSTATIC
"
]
;
then
echo
"-----> Collecting static files"
python
$MANAGE_FILE
collectstatic
--noinput
2>&1 |
sed
'/^Copying/d;/^$/d;/^ /d'
| indent
[
$?
-ne
0
]
&&
{
echo
" ! Error running manage.py collectstatic. More info:"
echo
" http://devcenter.heroku.com/articles/django-assets"
}
fi
echo
fi
bin/steps/django/collectstatic
deleted
100755 → 0
View file @
35ee2f60
#!/usr/bin/env bash
set
+e
# Syntax sugar.
indent
()
{
RE
=
"s/^/ /"
[
$(
uname
)
==
"Darwin"
]
&&
sed
-l
"
$RE
"
||
sed
-u
"
$RE
"
}
# Check if collectstatic is configured properly.
python
$MANAGE_FILE
collectstatic
--dry-run
--noinput
&> /dev/null
&&
RUN_COLLECTSTATIC
=
true
# Compile assets if collectstatic appears to be kosher.
if
[
"
$RUN_COLLECTSTATIC
"
]
;
then
echo
"-----> Collecting static files"
python
$MANAGE_FILE
collectstatic
--noinput
2>&1 |
sed
'/^Copying/d;/^$/d;/^ /d'
| indent
[
$?
-ne
0
]
&&
{
echo
" ! Error running manage.py collectstatic. More info:"
echo
" http://devcenter.heroku.com/articles/django-assets"
}
fi
echo
bin/steps/django/init
deleted
100755 → 0
View file @
35ee2f60
#!/usr/bin/env bash
SETTINGS_FILE
=
$(
find
.
-maxdepth
3
-type
f
-name
'settings.py'
|
head
-1
)
PROJECT
=
$(
dirname
$SETTINGS_FILE
)
MANAGE_FILE
=
$(
find
.
-maxdepth
3
-type
f
-name
'manage.py'
|
head
-1
)
MANAGE_FILE
=
${
MANAGE_FILE
:2
}
if
[
"
$FRESH_APP
"
]
;
then
# Legacy Django injection for existing applications.
touch
.heroku/injection_disabled
fi
# Disable injection for new applications.
if
[
-f
.heroku/injection_disabled
]
;
then
DISABLE_INJECTION
=
1
fi
if
[
-f
.heroku/collectstatic_disabled
]
;
then
DISABLE_COLLECTSTATIC
=
1
fi
export
SETTINGS_FILE MANAGE_FILE PROJECT DISABLE_INJECTION
if
[
!
"
$DISABLE_INJECTION
"
]
;
then
# Legacy Django injection for existing applications.
source
$BIN_DIR
/steps/django/injection
fi
if
[
!
"
$DISABLE_COLLECTSTATIC
"
]
;
then
source
$BIN_DIR
/steps/django/collectstatic
fi
bin/steps/django/injection
deleted
100755 → 0
View file @
35ee2f60
#!/usr/bin/env bash
# This script serves as the Django injection build step of the
# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python)
# compiler.
#
# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an
# adapter between a Python application and Heroku's runtime.
#
# This script is invoked by [`bin/compile`](/).
# ## Sanity Checks
#
# Syntax sugar.
indent
()
{
RE
=
"s/^/ /"
[
$(
uname
)
==
"Darwin"
]
&&
sed
-l
"
$RE
"
||
sed
-u
"
$RE
"
}
echo
"-----> Injecting legacy Django settings..."
echo
" ! WARNING: Settings injection will be fully deprecated on January 1, 2013. More info:"
echo
" ! https://devcenter.heroku.com/articles/django-injection "
echo
"-----> Installing dj-database-url..."
pip
install
--use-mirrors
'dj-database-url>=0.2.0'
| indent
SETTINGS_FILE
=
$(
find
.
-maxdepth
2
-type
f
-name
'settings.py'
|
head
-1
)
PROJECT
=
$(
dirname
$SETTINGS_FILE
)
echo
"Injecting code into
$SETTINGS_FILE
to read from DATABASE_URL"
| indent
cat
>>
$SETTINGS_FILE
<<
EOF
import dj_database_url
if 'DATABASES' not in locals():
DATABASES = {}
if not 'default' in DATABASES:
DATABASES['default'] = {}
DATABASES['default'].update(dj_database_url.config(default='postgres://'))
EOF
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