Ok that's the first (and hopefully only!) problem. That's the default 
application file.  Each application will need a slightly different 
wsgi-handler and I had to tweak it for OpenShift. You need to use the one 
from the Github project here:

https://github.com/prelegalwonder/openshift_web2py/blob/master/wsgi/application

Like I said, the fastest way is to follow the readme verbatim since those 
git commands replicate the template in the github project and then you just 
make your customizations from there and commit / push.

Let me know how that works.

On Friday, February 1, 2013 11:03:19 AM UTC-6, Chetan Patil wrote:
>
> Hi Andrew,
>
> On Fri, Feb 1, 2013 at 10:24 PM, Andrew <andrew....@gmail.com<javascript:>
> > wrote:
>
>>     1.) Post the contents of that file here
>>
>
> #!/usr/bin/python
> import os
>
> virtenv = os.environ['APPDIR'] + '/virtenv/'
> os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 
> 'lib/python2.6/site-packages')
> virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
> try:
>     execfile(virtualenv, dict(__file__=virtualenv))
> except IOError:
>     pass
> #
> # IMPORTANT: Put any additional includes below this line.  If placed above 
> this
> # line, it's possible required libraries won't be in your searchable path
> # 
>
> def application(environ, start_response):
>
> ctype = 'text/plain'
>  if environ['PATH_INFO'] == '/health':
> response_body = "1"
>  elif environ['PATH_INFO'] == '/env':
> response_body = ['%s: %s' % (key, value)
>                     for key, value in sorted(environ.items())]
> response_body = '\n'.join(response_body)
> else:
>  ctype = 'text/html'
> response_body = '''<!doctype html>
> <html lang="en">
> <head>
>   <meta charset="utf-8">
>   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
>   <title>Welcome to OpenShift</title>
>   <style>
>   html { 
>   background: black; 
>   }
>   body {
>     background: #333;
>     background: -webkit-linear-gradient(top, black, #666);
>     background: -o-linear-gradient(top, black, #666);
>     background: -moz-linear-gradient(top, black, #666);
>     background: linear-gradient(top, black, #666);
>     color: white;
>     font-family: "Helvetica Neue",Helvetica,"Liberation 
> Sans",Arial,sans-serif;
>     width: 40em;
>     margin: 0 auto;
>     padding: 3em;
>   }
>   a {
>      color: white;
>   }
>
>   h1 {
>     text-transform: capitalize;
>     -moz-text-shadow: -1px -1px 0 black;
>     -webkit-text-shadow: 2px 2px 2px black;
>     text-shadow: -1px -1px 0 black;
>     box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.5);
>     background: #CC0000;
>     width: 22.5em;
>     margin: 1em -2em;
>     padding: .3em 0 .3em 1.5em;
>     position: relative;
>   }
>   h1:before {
>     content: '';
>     width: 0;
>     height: 0;
>     border: .5em solid #91010B;
>     border-left-color: transparent;
>     border-bottom-color: transparent;
>     position: absolute;
>     bottom: -1em;
>     left: 0;
>     z-index: -1000;
>   }
>   h1:after {
>     content: '';
>     width: 0;
>     height: 0;
>     border: .5em solid #91010B;
>     border-right-color: transparent;
>     border-bottom-color: transparent;
>     position: absolute;
>      bottom: -1em;
>     right: 0;
>     z-index: -1000;
>   }
>   h2 { 
>     margin: 2em 0 .5em;
>     border-bottom: 1px solid #999;
>   }
>
>   pre {
>     background: black;
>     padding: 1em 0 0;
>     -webkit-border-radius: 1em;
>     -moz-border-radius: 1em;
>     border-radius: 1em;
>     color: #9cf;
>    }
>
>   ul { 
>     margin: 0; 
>     padding: 0;
>   }
>   li {
>     list-style-type: none;
>     padding: .5em 0;
>   }
>
>   .brand {
>     display: block;
>     text-decoration: none;
>   }
>   .brand .brand-image {
>     float: left;
>     border:none;
>   }
>   .brand .brand-text {
>     float: left;
>     font-size: 24px;
>     line-height: 24px;
>     padding: 4px 0;
>     color: white;
>     text-transform: uppercase;
>   }
>   .brand:hover,
>   .brand:active {
>     text-decoration: underline;
>   }
>
>   .brand:before,
>   .brand:after {
>     content: ' ';
>     display: table;
>   }
>   .brand:after {
>     clear: both;
>   }
>   </style>
> </head>
> <body>
>   <a href="http://openshift.com"; class="brand">
>     <img class="brand-image"
>       alt="OpenShift logo"
>       
> src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAgCAYAAABU1PscAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz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8pIjZMXcfFmm1gOg2lRaSRdT1AD1PBPQbCAyxcRMifCpc41HEtILNbh9s8SSvYTUmBp2LDGOdCOB1OD0XbeByWliwY5bugc9nU2T4wqhCx7PNAV9bSGwARp3TzVaP0j09GQUzJubLUgefY3SEHMh63MVr4FIlYL+7C1AlCwAmxM+/plYy6hhgN2xp1HBawAr72krnH3uoicTaXyHx7uIwKZoT0QhUhszAAI7x7ivL0a60/jp77yyTFrWt6N6rxE99c7OkxdiBhC2y/cAorXHpama/aNG8dkOO32b6p3zTzXmeysfPu4LkkKafA3IrGjfCfPtuGfiPlfx+xBsuWtwpa3zIuy2YaoZ5o0eSQc5TVnb53aeeAuk9eBtRvkqUH0MoTsqA7nL429eFzeA3lyfQ08eaiNgCrjTYNozQ1S+WyUfQCosTLqZ+oiDUNwhggPujpZTuCMXGwUV6cJgKYnNIJffR3df2NLLZ5871puQrUR//pzpU7rOnAfJP53eDELrsoPpk4RIGRn5xqIBAAdBOCAoBjBjPJsJUdZSt9HSOGFrld5cn2M4KbwfkIUJzqYhQlYWdJ7YN2FrFQCY3nPsmk61AuSuRNYyUdaiRBk/7tViR37Zcir1JYC8WNshgjWWPfhq0dmzVx/5bhQAWnLKU1Md8gZHOsjxAgmD2GEKq4s6m1sxASQPu16HiBh53goqPg9ac0TEcwNQEOBlQAZEcMgC94dDZt2c7r8GMIH0H43ZRDC51RVCAAAAAElFTkSuQmCC">
>     <div class="brand-text"><strong>Open</strong>Shift</div>
>   </a>
>   <h1>
>     Welcome to OpenShift
>   </h1>
>   <p>
>     Place your application here
>   </p>
>   <p>
>     In order to commit to your new project, go to your projects git repo 
> (created with the rhc app create command).  Make your changes, then run:
>   </p>
>   <pre>
>     git commit -a -m 'Some commit message'
>     git push
>   </pre>
>   <p>
>     Then reload this page.
>   </p>
>   
>   <h2>
>     What's next?
>   </h2>
>   <ul>
>     <li>
>       Why not visit us at <a href="http://openshift.redhat.com";>
> http://openshift.redhat.com</a>, or
>     </li>
>     <li>
>       You could get help in the <a 
> href="http://www.redhat.com/openshift";>OpenShift 
> forums</a>, or
>     </li>
>     <li>
>       You're welcome to come chat with us in our IRC channel at #openshift 
> on freenode.net
>     </li>
>   </ul>
> </body>
> </html>'''
>
> status = '200 OK'
> response_headers = [('Content-Type', ctype), ('Content-Length', 
> str(len(response_body)))]
>  #
> start_response(status, response_headers)
> return [response_body]
>
> #
> # Below for testing only
> #
> if __name__ == '__main__':
> from wsgiref.simple_server import make_server
>  httpd = make_server('localhost', 8051, application)
> # Wait for a single request, serve it and quit.
>  httpd.handle_request()
>
>  
>
>>     2.) ssh into your instance and cd to $OPENSHIFT_REPO_DIR and check 
>> the contents of it there to make sure it matches
>>
>
>  Yes. It matches :
>
> [web2py-pywebapps.rhcloud.com ~]\> ls
> app-root  git  python-2.6
> [web2py-pywebapps.rhcloud.com ~]\> cd $OPENSHIFT_REPO_DIR
> [web2py-pywebapps.rhcloud.com repo]\> ls
> 1     httpserver.pid   routes.example.py
> anyserver.py     __init__.py   scgihandler.py
> appengine_config.example.py  isapiwsgihandler.py   scripts
> applications     libs   setup_app.py
> app.yaml     LICENSE   setup_exe.py
> cgihandler.py     logging.example.conf  setup.py
> CHANGELOG     Makefile   site-packages
> data     modpythonhandler.py   splashlogo.gif
> deposit     options_std.py   VERSION
> epydoc.conf     parameters_8000.py    web2py.py
> epydoc.css     parameters_8001.py    welcome.w2p
> fcgihandler.py     queue.example.yaml    wsgi
> gaehandler.py     README   wsgihandler.py
> gluon     README.markdown
> httpserver.log     router.example.py
>
>
>
>
> -- 
> Thank You and Warm Regards,
>  
> Chetan Arvind Patil,
> www.chetanpatil.info
>  
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to