Re: [web2py] Re: Web2Py on OpenShift
Hi Andrew, Thanks for your reply. On Fri, Feb 1, 2013 at 9:01 PM, Andrew andrew.replo...@gmail.com wrote: So if you don't want to use the above two git statements, you also need to copy the following for starters: 1.) application from github project to your-project/wsgi/ 2.) .openshift from github project to your-project/ 3.) setup.pyfrom github project to your-project/ 4.) libs/gluon from github project to your-project/libs (also make sure gluon is symlinked from your-project/wsgi/web2py/gluon - your-project/libs/gluon Try that and redo your git add . from the project root, commit and push and let me know how it goes. Followed the steps, however same issue. The welcome page is coming. I'll once again explain what I have : 1) I have created an rhc app named web2py. 2) After that I have moved all the contents where I did localhost app development. So those are the files of web2py official source with my application residing next to the welcome or admin app inside application folder. 3) So the web2py folder I created using rhc has everything. 4) Now I'm pushing this to red hat open shift. I also did the changes said above. Structure of rhc app directory on my system : openshift(folder)/ /web2py(rhc created folder)/ /(web2py official source including my application) I'm terribly doing something bad. -- 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.
Re: [web2py] Re: Web2Py on OpenShift
Chetan, No worries, I'm confident we'll get you up and going. The fact that the default Openshift page is still coming up tells me one of two things: 1.) Your wsgi-handler (your-project/wsgi/application) isn't setup correctly 2.) It *is* setup correctly but for some reason it's not overriding the default one in the openshift hosted environment when you do a git push. Can you take the following action: 1.) Post the contents of that file here 2.) ssh into your instance and cd to $OPENSHIFT_REPO_DIR and check the contents of it there to make sure it matches Cheers, Andrew On Friday, February 1, 2013 9:55:11 AM UTC-6, Chetan Patil wrote: Hi Andrew, Thanks for your reply. On Fri, Feb 1, 2013 at 9:01 PM, Andrew andrew@gmail.com javascript: wrote: So if you don't want to use the above two git statements, you also need to copy the following for starters: 1.) application from github project to your-project/wsgi/ 2.) .openshift from github project to your-project/ 3.) setup.pyfrom github project to your-project/ 4.) libs/gluon from github project to your-project/libs (also make sure gluon is symlinked from your-project/wsgi/web2py/gluon - your-project/libs/gluon Try that and redo your git add . from the project root, commit and push and let me know how it goes. Followed the steps, however same issue. The welcome page is coming. I'll once again explain what I have : 1) I have created an rhc app named web2py. 2) After that I have moved all the contents where I did localhost app development. So those are the files of web2py official source with my application residing next to the welcome or admin app inside application folder. 3) So the web2py folder I created using rhc has everything. 4) Now I'm pushing this to red hat open shift. I also did the changes said above. Structure of rhc app directory on my system : openshift(folder)/ /web2py(rhc created folder)/ /(web2py official source including my application) I'm terribly doing something bad. -- 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.
Re: [web2py] Re: Web2Py on OpenShift
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.comjavascript: 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 titleWelcome 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: #CC; 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
Re: [web2py] Re: Web2Py on OpenShift
Hello Andrew On Fri, Feb 1, 2013 at 11:43 PM, Andrew andrew.replo...@gmail.com wrote: 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. Thanks for your reply. Appreciate it. I'm a beginner here and all I'm doing is the manual work. This is what I did : 1) First I updated the application file as your said and did commit push and I got : Internal Server Error. At least something is happening now. 2) Then to make things work, I ran those two git commands and it got merged with master. Then I did push and I got : *And it worked!* * * Now the issue is : I have followed the password hashed line as you said i.e. to copy parameters_8080.oy to wsgi/web2py. However the applications I see in the web2py on openshift link of mine doesn't contain my application. It contains default application, even those which I had deleted. How can this be possible ? -- 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.
Re: [web2py] Re: Web2Py on OpenShift
Hello Andrew, On Sat, Feb 2, 2013 at 8:53 AM, Chetan Patil chtpa...@gmail.com wrote: Now the issue is : I have followed the password hashed line as you said i.e. to copy parameters_8080.oy to wsgi/web2py. However the applications I see in the web2py on openshift link of mine doesn't contain my application. It contains default application, even those which I had deleted. How can this be possible ? Fine. I got whats happening now. The web2py on openshift is fetching files under wsgi/web2py After moving application under wsgi/web2py/application things got working. -- 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.
Re: [web2py] Re: Web2Py on OpenShift
Hello Andrew, Thanks for your help due to which I was able to get web2py app up and running. May you please point me to some weblinks where in I will be able to understand on how to host only the application and to avoid visitors to navigate into web2py IDE and other admins links. Like I just want this link to be active and nothings else : rhAppname/myapp/default/index -- 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.
Re: [web2py] Re: Web2Py on OpenShift
On Sun, Oct 21, 2012 at 1:57 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Notice you can do $ pip install pyfilesystem import pyfilesystem s3 = fs.s3fs.S3FS() db.define_table('mytable',,Field('file','upload',uploadfs = s3),...) You can use any pyfilesystem (s3, dropbox, ftp, zip, etc) to store your uploads. Wow thanks, that upload stuff will come in handy :) On Saturday, 20 October 2012 09:50:39 UTC-5, Andrew wrote: Ashraf, I replied on the github issue as well but you should be able to add boto to web2py lib and use it to store photos on your S3 account without issue. Let me know if you run into any problems. Regards, Andrew On Saturday, October 20, 2012 9:43:08 AM UTC-5, apps in tables wrote: Hi, which cloud storage service is accessible from openshift-deployed web2py app? s3 , dropbox , google drive , ... My main purpose is to store photos. Regards, Ashraf -- --
Re: [web2py] Re: Web2Py on OpenShift
I haven't attempted with a recent release. I'll pull down trunk and see if I can get the admin working. Keep in mind that when an OpenShift gear is started, your configuration is copied from the git area to a runtime area and executed from there. So, while I haven't tested this and can't confirm for certain, I don't think code changes you'd make from the web IDE would persist between restarts unless you exported and re-imported the application. I think the ability to import / pull and push to git repo's will solve this issue and I'm working to evolve that functionality and add hg support as well. Keep in mind there's also the OpenShift deployer in trunk that you can use to develop locally and deploy your changes as long as your openshift template is on the same system. Regards, Andrew On Wed, Jul 25, 2012 at 2:15 PM, Alec Taylor alec.tayl...@gmail.com wrote: Looking good, but I was wondering, is it possible to get this working with latest trunk? I tried, but ended up with Internal errors before I was even presented with the enter admin password view. The welcome app worked fine though . Thanks On Saturday, June 9, 2012 1:07:39 AM UTC+10, Andrew wrote: Just FYI to anyone interested, I've put together a web2py template for OpenShift https://openshift.redhat.com/app/ (Red Hat's Opensource PaaS). You can find it here: - https://github.com/**prelegalwonder/openshift_** web2py https://github.com/prelegalwonder/openshift_web2py I've also put together a basic openshift deployer from the admin page, and you can grab the changes from my fork of web2py - https://github.com/ **prelegalwonder/web2py https://github.com/prelegalwonder/web2py It's just 3 files in the admin app: controllers/openshift.py views/openshift/deploy.html and a modification to views/default/site.html It's only requirement to work beyond having a local working openshift project is GitPython installed and accessible from the runtime that web2py is running in. So you can either run the admin app in the cloud and access it directly or run a local web2py instance and execute the deployer when you want to test out your changes. I'm working on a detailed blog that I intent to submit to the OpenShift team so they can put it on their site for getting started. Enjoy -- --
Re: [web2py] Re: Web2Py on OpenShift
Excellent, thanks. I haven't really looked at the newly built in OpenShift feature, but I'm pretty sure it just facilitates updating the application on OpenShift, rather than the application + web-framework. On Thu, Jul 26, 2012 at 6:23 AM, Andrew Replogle andrew.replo...@gmail.comwrote: I haven't attempted with a recent release. I'll pull down trunk and see if I can get the admin working. Keep in mind that when an OpenShift gear is started, your configuration is copied from the git area to a runtime area and executed from there. So, while I haven't tested this and can't confirm for certain, I don't think code changes you'd make from the web IDE would persist between restarts unless you exported and re-imported the application. I think the ability to import / pull and push to git repo's will solve this issue and I'm working to evolve that functionality and add hg support as well. Keep in mind there's also the OpenShift deployer in trunk that you can use to develop locally and deploy your changes as long as your openshift template is on the same system. Regards, Andrew On Wed, Jul 25, 2012 at 2:15 PM, Alec Taylor alec.tayl...@gmail.comwrote: Looking good, but I was wondering, is it possible to get this working with latest trunk? I tried, but ended up with Internal errors before I was even presented with the enter admin password view. The welcome app worked fine though . Thanks On Saturday, June 9, 2012 1:07:39 AM UTC+10, Andrew wrote: Just FYI to anyone interested, I've put together a web2py template for OpenShift https://openshift.redhat.com/app/ (Red Hat's Opensource PaaS). You can find it here: - https://github.com/**prelegalwonder/openshift_** web2py https://github.com/prelegalwonder/openshift_web2py I've also put together a basic openshift deployer from the admin page, and you can grab the changes from my fork of web2py - https://github.com/**prelegalwonder/web2pyhttps://github.com/prelegalwonder/web2py It's just 3 files in the admin app: controllers/openshift.py views/openshift/deploy.html and a modification to views/default/site.html It's only requirement to work beyond having a local working openshift project is GitPython installed and accessible from the runtime that web2py is running in. So you can either run the admin app in the cloud and access it directly or run a local web2py instance and execute the deployer when you want to test out your changes. I'm working on a detailed blog that I intent to submit to the OpenShift team so they can put it on their site for getting started. Enjoy -- -- --
Re: [web2py] Re: Web2Py on OpenShift
Updated the issue on github: https://github.com/prelegalwonder/openshift_web2py/issues/3 Will research wsgi spec tomorrow to see if this behavior is expected. --
Re: [web2py] Re: Web2Py on OpenShift
This is really fantastic! Just went to an OpenShift demo and the first thing I wondered was whether web2py was taking advantage of this service. Just tested it out and works great! Thanks, - Jake On Tue, Jul 3, 2012 at 10:15 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Thank you. This is great. On Friday, 8 June 2012 10:07:39 UTC-5, Andrew wrote: Just FYI to anyone interested, I've put together a web2py template for OpenShift (Red Hat's Opensource PaaS). You can find it here: - https://github.com/prelegalwonder/openshift_web2py I've also put together a basic openshift deployer from the admin page, and you can grab the changes from my fork of web2py - https://github.com/prelegalwonder/web2py It's just 3 files in the admin app: controllers/openshift.py views/openshift/deploy.html and a modification to views/default/site.html It's only requirement to work beyond having a local working openshift project is GitPython installed and accessible from the runtime that web2py is running in. So you can either run the admin app in the cloud and access it directly or run a local web2py instance and execute the deployer when you want to test out your changes. I'm working on a detailed blog that I intent to submit to the OpenShift team so they can put it on their site for getting started. Enjoy