Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rochacbruno-archive/shiftpy
OpenShift tools for running Python Apps on OpenShift Red Hat Cloud
https://github.com/rochacbruno-archive/shiftpy
Last synced: about 2 months ago
JSON representation
OpenShift tools for running Python Apps on OpenShift Red Hat Cloud
- Host: GitHub
- URL: https://github.com/rochacbruno-archive/shiftpy
- Owner: rochacbruno-archive
- License: mit
- Created: 2015-07-30T16:58:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-31T20:03:24.000Z (over 9 years ago)
- Last Synced: 2024-11-06T13:19:26.487Z (about 2 months ago)
- Language: Python
- Size: 108 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shiftpy
Tools for running Python Apps on OpenShift Red Hat Cloud[![Build Status](https://travis-ci.org/rochacbruno/shiftpy.svg?branch=master)](https://travis-ci.org/rochacbruno/shiftpy)
[![Code Health](https://landscape.io/github/rochacbruno/shiftpy/master/landscape.svg?style=flat)](https://landscape.io/github/rochacbruno/shiftpy/master)# installation
```pip install shiftpy```
# Available tools
- env.getvar - Get openshift env var
- env.listvars - Print all openshift env vars
- env.getallvars - Get all vars as a dict
- wsgi_utils.envify - Wrap wsgi app in Openshift Virtualenv
- **ADD YOURS, please contribute**# getvar
```python
> from shiftpy.env import getvar
> print getvar('HOMEDIR')
'app-root/w543543543543543/home/'
```# listvars
```python
> from shiftpy.env import listvars
> listvars()
OPENSHIFT_HOMEDIR = 'app-root/w543543543543543/home/'
OPENSHIFT_APP_NAME = 'yourappname'
...
```# getallvars
```python
> from shiftpy.env import getallvars
> allvars = getallvars()
> print allvars
{'OPENSHIFT_FOO': 'BAR',
'OPENSHIFT_HOMEDIR': '/tmp',
'OPENSHIFT_PYTHON_DIR': '/tmp/python'}```
# envify
This will wrap your wsgi app in virtualenv to OpenShift
```python
from shiftpy.wsgi_utils import envify
from myproject import app# wsgi expects an object named 'application'
application = envify(app)```
then your app will be available for wsgi_mod and virtualenv is activated