Skip to content

Commit

Permalink
add heroku support
Browse files Browse the repository at this point in the history
upgrade 0.1 to 0.1.1

git-svn-id: https://uliweb.googlecode.com/svn/trunk@914 14287918-b64d-0410-abb6-a92efa0c2026
  • Loading branch information
limodou committed May 26, 2012
1 parent 463b4cb commit 19e0816
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 0 deletions.
7 changes: 7 additions & 0 deletions uliweb/contrib/heroku/__init__.py
@@ -0,0 +1,7 @@
#coding=utf8
import os
import uliweb

def after_init_settings(sender):
from uliweb import settings
settings.ORM.CONNECTION = os.environ['DATABASE_URL']
6 changes: 6 additions & 0 deletions uliweb/contrib/heroku/conf.py
@@ -0,0 +1,6 @@
from uliweb.form import *

#class ManageForm(Form):
# debug_log = BooleanField(label='Debug Log:', key='ORM/DEBUG_LOG')
# auto_create = BooleanField(label='Auto Create Table:', key='ORM/AUTO_CREATE')
# connection = StringField(label='Database Connection String:', required=True, key='ORM/CONNECTION')
4 changes: 4 additions & 0 deletions uliweb/contrib/heroku/config.ini
@@ -0,0 +1,4 @@
[DEPENDS]
REQUIRED_APPS = [
'uliweb.contrib.orm',
]
8 changes: 8 additions & 0 deletions uliweb/contrib/heroku/info.ini
@@ -0,0 +1,8 @@
[info]
catalog = ''
title = ''
description = ''
icon = ''
author = ''
version = ''
homepage = ''
5 changes: 5 additions & 0 deletions uliweb/contrib/heroku/settings.ini
@@ -0,0 +1,5 @@
[ORM]
CONNECTION_TYPE = 'short'

[BINDS]
heroku.after_init_settings = 'after_init_settings', 'uliweb.contrib.heroku.after_init_settings'
2 changes: 2 additions & 0 deletions uliweb/template_files/support/heroku/.gitignore
@@ -0,0 +1,2 @@
venv
*.pyc
1 change: 1 addition & 0 deletions uliweb/template_files/support/heroku/Procfile
@@ -0,0 +1 @@
web: python app.py
12 changes: 12 additions & 0 deletions uliweb/template_files/support/heroku/app.py
@@ -0,0 +1,12 @@
import sys, os

path = os.path.dirname(os.path.abspath(__file__))
project_path = path
sys.path.insert(0, project_path)
sys.path.insert(0, os.path.join(path, 'lib'))

from uliweb.manage import make_application
from werkzeug.serving import run_simple
application = make_application(project_dir=project_path)

run_simple('0.0.0.0', int(os.environ.get('PORT', 5000)), application)
3 changes: 3 additions & 0 deletions uliweb/template_files/support/heroku/requirements.txt
@@ -0,0 +1,3 @@
Uliweb==0.1.1
psycopg2==2.4.5
SQLAlchemy==0.7.7

0 comments on commit 19e0816

Please sign in to comment.