Newbie question - using cgi to serve my app
Hello, I'm new to this framework, so pardon my ignorance, but here goes: I've spent a LOT of time trying to get this working on my server, and now I have some specific questions: I have gotten a project up and running, and I can verify it by starting the paster server, and then running a lynx webserver to localhost:5000. This shows I am getting the proper 'hello world' controller working (and the route that directs to the hello controller from the root url). However, I am still stuck on how to get the public to view my site, given that I am on a server without root privileges, and the Apache install does not have mod_python, mod_wsgi, or mod_fcgi. I do have mod_proxy, but I'm not clear how I can use that to serve my pages. I suppose I could redirect certain urls to point to the port 5000 paster server I found an article on how to use straight CGI to serve a WSGI application, and I got it working for static pages, by putting this script (called test.py) in my cgi-bin directory: #!/usr/home/rgamage/bin/python from paste.deploy import loadapp wsgi_app = loadapp('config:/usr/home/rgamage/siv/siv_production.ini') import wsgiref.handlers wsgiref.handlers.CGIHandler().run(wsgi_app) If I have a static index.html in the public directory, then this method works - going to http://mywebspace.com/cgi-bin/test.py yields the proper static welcome page. However, if I delete that index.html, I expect it to run the sample controller, hello, and instead I get this series of exceptions: Output of script follows: = Traceback (most recent call last): File /usr/local/lib/python2.5/wsgiref/handlers.py, line 92, in run self.result = application(self.environ, self.start_response) File /usr/home/rgamage/lib/python2.5/site-packages/Paste-1.4.2- py2.5.egg/paste/cascade.py, line 92, in __call__ return self.apps[-1](environ, start_response) File /usr/home/rgamage/lib/python2.5/site-packages/Paste-1.4.2- py2.5.egg/paste/registry.py, line 340, in __call__ app_iter = self.application(environ, start_response) File /usr/home/rgamage/lib/python2.5/site-packages/Paste-1.4.2- py2.5.egg/paste/recursive.py, line 80, in __call__ return self.application(environ, start_response) File /usr/home/rgamage/lib/python2.5/site-packages/Paste-1.4.2- py2.5.egg/paste/errordocument.py, line 185, in __call__ app_iter = self.application(environ, change_response) File /usr/home/rgamage/lib/python2.5/site-packages/Paste-1.4.2- py2.5.egg/paste/evalexception/middleware.py, line 180, in __call__ The EvalException middleware is not usable in a AssertionError: The EvalException middleware is not usable in a multi- process environment Status: 500 Dude, this is whack! Content-Type: text/plain Content-Length: 59 A server error occurred. Please contact the administrator. Any ideas you guys have would be much appreciated. Also, I don't quite understand how I would reference different controllers using the cgi method. The test.py script runs my application, but how would I specify which controller or page within the app? Is this method even a good idea, or should I make the jump to another hosting service that provides mod_python or mod_wsgi? Thanks, Randy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Newbie question - using cgi to serve my app
Rudy escreveu: I do have mod_proxy, but I'm not clear how I can use that to serve my pages. I suppose I could redirect certain urls to point to the port 5000 paster server That would be probably a better idea than CGI. Pylons has a big startup cost; it's better to pay it once than on each request. I vaguely remember some gotchas, but Ian Bicking wrote some middleware to handle it. Ah, someone else went to the trouble of documenting it (thank James Gardnet and Ben Bangert): http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+proxy+for+Pylons AssertionError: The EvalException middleware is not usable in a multi- process environment Clearly labeled. Edit the load_middleware function IIRC and have a look around, if you want to explore CGI a bit more deeply. Hope that helps, --lbruno signature.asc Description: OpenPGP digital signature
Documentation, Sphinx, linking
So, I think we're all interested in using Sphinx for documenting our projects. Well, I'm not sure about TG, but I know Ben is converting Pylons, and I'm planning to convert my projects (I got Paste setup so far, but not uploaded anywhere). Right now Ben is including documentation for some projects (like webob) directly on pylonshq, and I'm guessing that he's planning on adding more libraries. I'm not sure how I feel about this. In the case of a library that is managed by someone else and isn't going to be Sphinx-documented, that's fine (e.g., simplejson, as I don't know if there's any plans to change over its docs). But if webob documentation gets mirrored all over the place, that does bother me a bit. I dislike the ambiguity of the situation, where you could google for webob docs and get identical docs at a variety of locations, and easily come upon documentation for old versions without realizing that's what you had gotten. I understand the reasons for mirroring them too. To document the version of a library that you are using in your framework, to easily link to reference documentation using the Sphinx conventions, and to have navigation that is consistent across all the documentation. I'm not sure what the middleground is. For old versions, some Sphinx configuration to put strong notices in the template about the status of the version would do it. With linking, it might be resolvable with a modest amount of programming effort, if we could tell Sphinx how to link certain packages. That would still leave navigation unresolved, which unfortunately I have no solution for. I'm quite open the idea of some consistent styling so that the move from site to site isn't jarring, but that still doesn't give backlinks. Backlinks actually *would* be a sort of solution, and could be interesting. That is, if every page pointed to all the pages that point to it. This wouldn't be open backlinking, just closed among a whitelist of sites (and maybe a specifically maintained list too, for things like blog posts?) That wouldn't make the navigation exactly consistent, but maybe close enough? -- Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Newbie question - using cgi to serve my app
Thanks for the reply. The only trouble with redirecting to the paster server is that I don't know if I can leave the paster running after I log out. Right now, I have to log in and start the paster server, then start another login window and run lynx to test the server. When I log out the process gets killed. I can start it as a backround task, but I think it will still be killed when I log out. Thanks, Randy On May 2, 9:58 am, Luis Bruno [EMAIL PROTECTED] wrote: Rudy escreveu: I do have mod_proxy, but I'm not clear how I can use that to serve my pages. I suppose I could redirect certain urls to point to the port 5000 paster server That would be probably a better idea than CGI. Pylons has a big startup cost; it's better to pay it once than on each request. I vaguely remember some gotchas, but Ian Bicking wrote some middleware to handle it. Ah, someone else went to the trouble of documenting it (thank James Gardnet and Ben Bangert):http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+p... AssertionError: The EvalException middleware is not usable in a multi- process environment Clearly labeled. Edit the load_middleware function IIRC and have a look around, if you want to explore CGI a bit more deeply. Hope that helps, --lbruno signature.asc 1KDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Newbie question - using cgi to serve my app
can you launch the paster server from within screen? That is how I do it when developing then when I go production I use daemontools to monitor it Rudy wrote: Thanks for the reply. The only trouble with redirecting to the paster server is that I don't know if I can leave the paster running after I log out. Right now, I have to log in and start the paster server, then start another login window and run lynx to test the server. When I log out the process gets killed. I can start it as a backround task, but I think it will still be killed when I log out. Thanks, Randy On May 2, 9:58 am, Luis Bruno [EMAIL PROTECTED] wrote: Rudy escreveu: I do have mod_proxy, but I'm not clear how I can use that to serve my pages. I suppose I could redirect certain urls to point to the port 5000 paster server That would be probably a better idea than CGI. Pylons has a big startup cost; it's better to pay it once than on each request. I vaguely remember some gotchas, but Ian Bicking wrote some middleware to handle it. Ah, someone else went to the trouble of documenting it (thank James Gardnet and Ben Bangert):http://wiki.pylonshq.com/display/pylonscookbook/Apache+as+a+reverse+p... AssertionError: The EvalException middleware is not usable in a multi- process environment Clearly labeled. Edit the load_middleware function IIRC and have a look around, if you want to explore CGI a bit more deeply. Hope that helps, --lbruno signature.asc 1KDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
notmm-0.2.10p8 released
Hi, notmm-0.2.10p8 has just been released yesterday. It sports numerous bug fixes and also have several new features, examples and improved documentation. Best regards, Etienne http://pypi.python.org/pypi/notmm/0.2.10p8 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Newbie question - using cgi to serve my app
On Fri, 2008-05-02 at 10:55 -0700, Rudy wrote: Thanks for the reply. The only trouble with redirecting to the paster server is that I don't know if I can leave the paster running after I log out. Right now, I have to log in and start the paster server, then start another login window and run lynx to test the server. When I log out the process gets killed. I can start it as a backround task, but I think it will still be killed when I log out. There's several utilities for managing this (screen, dtach, etc), but the good old-fashioned way is nohup: $ nohup paster serve myapp.cfg Regards, Cliff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: notmm-0.2.10p8 released
On Fri, 2008-05-02 at 11:58 -0700, Etienne Robillard wrote: Hi, notmm-0.2.10p8 has just been released yesterday. It sports numerous bug fixes and also have several new features, examples and improved documentation. What is it? There's not much of a description on pypi and the home page is blank. Cliff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: notmm-0.2.10p8 released
On May 2, 3:35 pm, Cliff Wells [EMAIL PROTECTED] wrote: On Fri, 2008-05-02 at 11:58 -0700, Etienne Robillard wrote: Hi, notmm-0.2.10p8 has just been released yesterday. It sports numerous bug fixes and also have several new features, examples and improved documentation. What is it? There's not much of a description on pypi and the home page is blank. Cliff Hi Cliff, Sorry about that. The old wiki is still available here: http://tools.assembla.com/notmm/ Thanks, Etienne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: notmm-0.2.10p8 released
On May 2, 2008, at 11:58 AM, Etienne Robillard wrote: notmm-0.2.10p8 has just been released yesterday. It sports numerous bug fixes and also have several new features, examples and improved documentation. Please don't spam the pylons-discuss list. I consider this spam because: - It's not discussing pylons, nor was there any mention of using Pylons - It's advertising a release for a non-Pylons related package The more appropriate place for announcing WSGI based libraries/ frameworks would be Web-SIG, and/or perhaps django-discuss as its Django based. I have to point this out or I'll have no reason not to accept any and every announcement of every single WSGI library/package that someone release. ;) Thanks, Ben smime.p7s Description: S/MIME cryptographic signature
Re: Paginate module
On Thu, May 1, 2008 at 3:18 PM, Christoph Haas [EMAIL PROTECTED] wrote: Hi, Jorge... On Donnerstag, 1. Mai 2008, Jorge Vargas wrote: hi I was going to ask about this but I saw this recent thread regarding the pagination and it seems better to follow up on this than to start a new thread. Please note this is my first time working on paginated data with pylons. From what I understand currently pylons has 3 different pagination modules. 1- current released webhelpers package (0.3.x) http://pypi.python.org/pypi/WebHelpers/ 2- current trunk webhelpers package (0.6.x) - side question what happen to .4 and .5? 3- the paginate module http://paginate.workaround.org/?page_nr=1 and http://pypi.python.org/pypi/paginate/0.3.2 There has been much confusion indeed. For a long time there has been the webhelpers.pagination module that Ben ported from Ruby-on-Rails (1). I was very unhappy with it because the documentation was not clear for non Ruby-on-Rails users and it took some source-code reading to figure out how to use it. And even then it was not very comfortable. So I started working on an alternative pagination module. A working version is what you can find on PyPi and on paginate.workaround.org (3). Then Mike, Ben and I decided that it's time my module gets integrated into the next version of webhelpers (2). Currently the webhelpers version 0.6 is in the making and is probably released soon. The paginate module is now integrated there and I'm currently working on the last cosmetic changes. Webhelpers 0.4 and 0.5 have never been released AFAIK. now #3 was supposed to become part of webhelpers (so I read), does that means #3 and #2 are the same? The webhelpers.paginate (#3) version is newer and has a few more features. #2 is still fully usable if you need it outside of a Pylons context. why #1 got replaced? what are it's problems? IMHO webhelpers.pagination is uncomfortable, doesn't have enough useful features and needs too much code to get simple pagination. will #2 and #3 work with current released pylons (0.9.6.x)? When webhelpers 0.6 are released you won't need #3 seperately any more. overall what are the differences between the three modules? and which one is recommended for production, right now I'm interested in having as little tip/head dependencies as possible for this project as it's launch date is really near. I'm confident that #2 is stable. I'm using it in two real-life projects already. Feel free to use that. which one is more future proof, for example I assume #1 will go away ones pylons 0.9.7 gets out. #1 is still present in webhelpers 0.6 but deprecated. It will go away. Pylons 0.9.7 depends on webhelpers 0.6 so you can still use it if you have code using it. Christoph (hoping he didn't tell nonsense) -- When you do things right people won't be sure you've done anything at all. Thank you very much on this input. this is exactly what I was looking for. then I guess the short version (for people reading this in the future will be) if you like/know RoR pagination go with #1 if you want a better implementation use #2 and after 0.9.7 go with #3 (or if you are feeling experimental) I have installed and configure #2 and I find it great, documentation is excelent and the sample project is really something. Thanks for this great module. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: notmm-0.2.10p8 released
On May 2, 4:59 pm, Ben Bangert [EMAIL PROTECTED] wrote: On May 2, 2008, at 11:58 AM, Etienne Robillard wrote: notmm-0.2.10p8 has just been released yesterday. It sports numerous bug fixes and also have several new features, examples and improved documentation. Please don't spam the pylons-discuss list. I consider this spam because: - It's not discussing pylons, nor was there any mention of using Pylons - It's advertising a release for a non-Pylons related package The more appropriate place for announcing WSGI based libraries/ frameworks would be Web-SIG, and/or perhaps django-discuss as its Django based. I have to point this out or I'll have no reason not to accept any and every announcement of every single WSGI library/package that someone release. ;) Thanks, Ben Thanks for refering to notmm as spam. It's truly a historical moment :) I love Pylons and Python! Etienne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Paginate module
#1 (Rails pagination) is deprecated and will eventually be deleted, perhaps by Pylons 1.0. Not recommended for any new project. #2 (webhelpers.paginate) is the right answer. The latest version was just pushed yesterday. #3 (paginate.workaround.org) works but is falling out of date. If you're still on WebHelpers 0.3, you can copy it into your application for now. That's actually what I have in my current application, a slightly older version of #3. I'm waiting till WebHelpers 0.6 is released before I move my app to it. -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: notmm-0.2.10p8 released
On May 2, 2008, at 2:52 PM, Etienne Robillard wrote: Thanks for refering to notmm as spam. It's truly a historical moment :) I didn't say notmm is spam, I said that sending release announcements to only remotely related user group lists is 'spamming' like behavior as pylons-discuss is for Pylons discussion, not for WSGI library announcements. There's at least several dozen WSGI libraries out there, while Pylons is big on WSGI, I certainly don't want to see every single release of every single WSGI based library announcing it on the pylons-discuss list. I don't mind Pylons oriented packages advertising a new release on pylons-discuss if it includes an example or some write-up in it of how its used in pylons or why Pylons users would want to use it in their Pylons app. But I do have to draw a line somewhere to avoid pylons- discuss from being a dumping-ground for WSGI library announcements. :) Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
tg_flash equivalent in pylons?
Hello, I am fairly new to pylons, so far I really like it. I think it is a big improvement over Turbogears. However I have one question. Is there any equivalent functionality to the Turbogears' tg_flash' in Pylons? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: tg_flash equivalent in pylons?
On Fri, May 2, 2008 at 7:04 PM, noflashlight [EMAIL PROTECTED] wrote: Hello, I am fairly new to pylons, so far I really like it. I think it is a big improvement over Turbogears. However I have one question. Is there any equivalent functionality to the Turbogears' tg_flash' in Pylons? there is one in webhelpers although with the recent changes you need to look out which version of webhelpers you are using to know where to find it. as for the improvement I have to disagree TG1 gives you more than pylons in fact pylons is like a barebone TG. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: tg_flash equivalent in pylons?
On Fri, May 2, 2008 at 4:22 PM, Jorge Vargas [EMAIL PROTECTED] wrote: On Fri, May 2, 2008 at 7:04 PM, noflashlight [EMAIL PROTECTED] wrote: Hello, I am fairly new to pylons, so far I really like it. I think it is a big improvement over Turbogears. However I have one question. Is there any equivalent functionality to the Turbogears' tg_flash' in Pylons? there is one in webhelpers although with the recent changes you need to look out which version of webhelpers you are using to know where to find it. It's webhelpers.containers.Flash, previously webhelpers.tools.Flash. as for the improvement I have to disagree TG1 gives you more than pylons in fact pylons is like a barebone TG. -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: tg_flash equivalent in pylons?
as for the improvement I have to disagree TG1 gives you more than pylons in fact pylons is like a barebone TG. To many of us, that IS the huge improvement ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---