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
5392882f
Commit
5392882f
authored
May 18, 2011
by
Noah Zoschke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readme
parent
75f5e801
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
21 deletions
+37
-21
Readme.md
Readme.md
+37
-21
No files found.
Readme.md
View file @
5392882f
virtualenv
----------
Python Language Pack
--------------------
The Python Language Pack (PLP) is a language pack for running Python and Django
apps on Heroku.
pi
p
---
If
`requirements.txt`
is present, the PLP considers the directory a Python ap
p
with packages to install via pip.
Django settings.py
------------------
Sets up a db for every ENV ${NAME}_URL => postgres:// var:
DATABASES["DATABASE"]
DATABASES["SHARED_DATABASE"]
DATABASES["HEROKU_POSTGRESQL_ONYX"]
Furthermore, if
`${project}/settings.py`
is present, the PLP considers the
directory a Python/Django app, and patches
`settings.py`
to parse the Heroku
DATABASE_URL config vars. It then sets default process types to use the Django
web server and console.
Aliases DATABASE_URL to default database:
Compile Hooks
-------------
The PLP uses a Makefile for user-controlled hooks into slug compilation. If
present, the
`environment`
rule will be eval'd in the compile script, allowing
user-defined exports.
DATABASES["default"] = DATABASES["DATABASE"]
The environment variables referenced in the compile script are:
Injected right after DATABASES = {...}
PIP_OPTS
Hooks
-----
Uses a Makefile for user-controlled hooks into slug compilation.
Target
`environment`
will be evald in the build script, allowing
custom exports. PIP_OPTS is passed to pip if set.
A sample Makefile to force a re-build of every pip package is:
environment:
export PIP_OPTS=--upgrade
Django settings.py
------------------
The PLP injects code into settings.py to alias every Heroku database URL
config var. Every variable of the format ${NAME}_URL => postgres:// will be
added to the settings.DATABASES hash.
On an app with both a shared SHARED_DATABASE_URL and a dedicated
HEROKU_POSTGRESQL_RED_URL that is promoted to DATABASE_URL, settings will look
like:
{
'DATABASE': {'ENGINE': 'psycopg2', 'NAME': 'dedicated', ...},
'HEROKU_POSTGRESQL_RED': {'ENGINE': 'psycopg2', 'NAME': 'dedicated', ...},
'SHARED': {'ENGINE': 'psycopg2', 'NAME': 'shared', ...},
'default': {'ENGINE': 'psycopg2', 'NAME': 'dedicated', ...},
}
These aliases can be referenced and further modified at the end of the settings file.
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