Tools for Python Apps on OpenShift Red Hat Cloud
Project description
# shiftpy
Tools for running Python Apps on OpenShift Red Hat Cloud
# install
```pip install shiftpy```
# Tools
- env.getvar - Get openshift env var
- env.listvars - List all openshift env vars
- 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'
...
```
# 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
Tools for running Python Apps on OpenShift Red Hat Cloud
# install
```pip install shiftpy```
# Tools
- env.getvar - Get openshift env var
- env.listvars - List all openshift env vars
- 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'
...
```
# 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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shiftpy-0.1.0.tar.gz
(2.4 kB
view details)
File details
Details for the file shiftpy-0.1.0.tar.gz
.
File metadata
- Download URL: shiftpy-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de72321be27e53d02ff69a001bb29d2240f78635444df14d63e9c52efb421c71 |
|
MD5 | d54baa49ab781c302c8bacddb9946291 |
|
BLAKE2b-256 | 1ab40247193855fd486a595142ad9b3a32a456f092971a039e4d9411ad57e3e2 |