Last active
August 29, 2015 14:00
-
-
Save marknorgren/11328099 to your computer and use it in GitHub Desktop.
dreamhost - pip - virtualenv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Detailed explanation at http://hitesh.in/2011/running-a-bottle-py-app-on-dreamhost/ | |
| #1. Add current directory to path, if isn't already | |
| import sys, os | |
| #INTERP = os.path.join(os.environ['HOME'], '~/bottle.mrkd.co/bottle_env', 'bin', 'python') | |
| INTERP = os.path.expanduser("~/bottle.mrkd.co/bottle_env/bin/python") | |
| if sys.executable != INTERP: | |
| os.execl(INTERP, INTERP, *sys.argv) | |
| sys.path.append(os.getcwd()) | |
| import bottle | |
| from bottle import route, run, template | |
| ZEROBIN_PARENT_DIR = os.path.dirname(os.path.dirname(__file__)) | |
| sys.path.insert(0, ZEROBIN_PARENT_DIR) | |
| # create the wsgi callable | |
| from zerobin.routes import get_app | |
| settings, application = get_app(compressed_static=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment