How to turn off traceback when running as fcgi.

2007-11-20 Thread Jakub Stolarski

Hi,

I use this:

[server:main]
use = egg:PasteScript#flup_fcgi_fork

to run pylons application. When there is error in application I get
traceback from flup even with debug = false.

How can I turn this off on production site?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Multiple controller calls

2007-11-20 Thread Justin

Just out of curiosity I put a line in BaseController to print out the
name of the current controller class when called and was suprised to
see 7 seperate controller calls for a single url:

my test controller
template.TemplateController
template.TemplateController
error.ErrorController
template.TemplateController
error.ErrorController
error.ErrorController


--~--~-~--~~~---~--~~
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: Multiple controller calls

2007-11-20 Thread Justin

Sorry, I got cut off.. Anyway, the order is as follows:

1. my test controller
2. template.TemplateController
3. template.TemplateController
4. error.ErrorController
5. template.TemplateController
6. error.ErrorController
7. error.ErrorController

This is for a test view that just returns a simple string to the
browser and the page is returned as is should be without error. Is
this normal? What is the purpose of all these controller calls? Right
now I'm just evaluating pylons but this strikes me as inefficient and
obtuse.

Thanks,

- Justin
--~--~-~--~~~---~--~~
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: Multiple controller calls

2007-11-20 Thread Philip Jenvey


On Nov 20, 2007, at 11:05 AM, Justin wrote:


 Sorry, I got cut off.. Anyway, the order is as follows:

 1. my test controller
 2. template.TemplateController
 3. template.TemplateController
 4. error.ErrorController
 5. template.TemplateController
 6. error.ErrorController
 7. error.ErrorController

 This is for a test view that just returns a simple string to the
 browser and the page is returned as is should be without error. Is
 this normal? What is the purpose of all these controller calls? Right
 now I'm just evaluating pylons but this strikes me as inefficient and
 obtuse.

Pylons is going to construct a Controller and call the specified  
action once per request. If that controller returns an error HTTP  
response code, Pylons will route the request to the error page (so  
you get a pretty 404 or whatever page). Triggering the error page  
means construction of an ErrorController and a call to its error page  
action.

Assuming you're using the default TemplateController and its  
accompanying catch-all route, this means your browser is actually  
hitting TemplateController 3 times. The default TemplateController  
simply abort()s, hence the ErrorControllers.

One of the requests is most likely for the favicon, I don't know  
about the other one (it probably has to do with the rendered error  
page). You can see what URL path was requested by printing out  
request.path_info.

--
Philip Jenvey



--~--~-~--~~~---~--~~
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: Multiple controller calls

2007-11-20 Thread Mike Orr

On Nov 20, 2007 11:05 AM, Justin [EMAIL PROTECTED] wrote:

 Sorry, I got cut off.. Anyway, the order is as follows:

 1. my test controller
 2. template.TemplateController
 3. template.TemplateController
 4. error.ErrorController
 5. template.TemplateController
 6. error.ErrorController
 7. error.ErrorController

 This is for a test view that just returns a simple string to the
 browser and the page is returned as is should be without error. Is
 this normal? What is the purpose of all these controller calls? Right
 now I'm just evaluating pylons but this strikes me as inefficient and
 obtuse.

Are you sure it's not making all those requests, perhaps for images or
stylesheets?  I tried what you said, putting

print Controller is, self.__class__.__name__

at the beginning of BaseController.__call__() in one of my
applications,  It prints the expected controller, not the extra lines.
 But if I go to a nonexistent page, I get this:

Controller is TemplateController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController

TemplateController is the one in your last routing rule, which matches
if no other routes have matched.  By default it always reports 404
Not Found.  This is caught by the ErrorDocuments middleware, which
makes a subrequest for the error page -- the first ErrorController
call.  The other ErrorController calls are stylesheets and images for
that page.

If you still can't figure it out, show us your controller class, any
changes you've made to the routing, and the URL you're requesting, and
maybe that will clear it up.

-- 
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: Multiple controller calls

2007-11-20 Thread Justin

Thank you both for your responses. Right now, I'm just evaluating the
framework to see if it seems like a good fit so the controller doesn't
do much (the the output above was from calling the test action that
I was using to test accessing route variables):

class HelloController(BaseController):

def index(self):
# Return a rendered template
#   return render('/some/template.mako')
# or, Return a response
return 'Hello World!'

def test(self, var):
id = var
if int(id)  5:
return 'GREATER THAN'
else:
return 'LESS THAN'

My routes:

def make_map():
Create, configure and return the routes Mapper
map = Mapper(directory=config['pylons.paths']['controllers'],
 always_scan=config['debug'])

# The ErrorController route (handles 404/500 error pages); it
should
# likely stay at the top, ensuring it can always be resolved
map.connect('error/:action/:id', controller='error')

# CUSTOM ROUTES HERE

map.connect('hello/test/:var', controller='hello', action='test',
var=novar)
map.connect(':controller/:action/:id')
map.connect('*url', controller='template', action='view')

return map

Requested url:

http://localhost:5000/hello/test/10/

Base controller:

class BaseController(WSGIController):

def __call__(self, environ, start_response):
Invoke the Controller
# WSGIController.__call__ dispatches to the Controller method
# the request is routed to. This routing information is
# available in environ['pylons.routes_dict']
try:
return WSGIController.__call__(self, environ,
start_response)
finally:
Session.remove()
print self.__class__

I also printed out the return value of each controller called and the
error controllers are returning a 404 page each time. However, the
browser returns GREATER THAN as expected.

On Nov 20, 2:45 pm, Mike Orr [EMAIL PROTECTED] wrote:
 On Nov 20, 2007 11:05 AM, Justin [EMAIL PROTECTED] wrote:





  Sorry, I got cut off.. Anyway, the order is as follows:

  1. my test controller
  2. template.TemplateController
  3. template.TemplateController
  4. error.ErrorController
  5. template.TemplateController
  6. error.ErrorController
  7. error.ErrorController

  This is for a test view that just returns a simple string to the
  browser and the page is returned as is should be without error. Is
  this normal? What is the purpose of all these controller calls? Right
  now I'm just evaluating pylons but this strikes me as inefficient and
  obtuse.

 Are you sure it's not making all those requests, perhaps for images or
 stylesheets?  I tried what you said, putting

 print Controller is, self.__class__.__name__

 at the beginning of BaseController.__call__() in one of my
 applications,  It prints the expected controller, not the extra lines.
  But if I go to a nonexistent page, I get this:

 Controller is TemplateController
 Controller is ErrorController
 Controller is ErrorController
 Controller is ErrorController
 Controller is ErrorController
 Controller is ErrorController
 Controller is ErrorController
 Controller is ErrorController

 TemplateController is the one in your last routing rule, which matches
 if no other routes have matched.  By default it always reports 404
 Not Found.  This is caught by the ErrorDocuments middleware, which
 makes a subrequest for the error page -- the first ErrorController
 call.  The other ErrorController calls are stylesheets and images for
 that page.

 If you still can't figure it out, show us your controller class, any
 changes you've made to the routing, and the URL you're requesting, and
 maybe that will clear it up.

 --
 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: Multiple controller calls

2007-11-20 Thread Mike Orr

On Nov 20, 2007 12:02 PM, Justin [EMAIL PROTECTED] wrote:
 Thank you both for your responses. Right now, I'm just evaluating the
 framework to see if it seems like a good fit so the controller doesn't
 do much

We like troubleshooting small, simple examples. :)

 def test(self, var):
 id = var
 if int(id)  5:
 return 'GREATER THAN'
 else:
 return 'LESS THAN'

You'll run into trouble here if var is '' or contains non-numeric
characters.  Your default value in the routing rule is novar, which
would raise a ValueError exception and ultimately a 500 Internal
Server Error.  Since we can't trust users to always put numeric
values, you should trap the case thus:

if not var.isdigit():
return Third URL component must be numeric.

 map.connect('hello/test/:var', controller='hello', action='test',
 var=novar)


 Requested url:

 http://localhost:5000/hello/test/10/

Does it make a difference if you omit the trailing slash?

 I also printed out the return value of each controller called and the
 error controllers are returning a 404 page each time.

You mean the error controller itself is failing to return a page?

-- 
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: CMS tools

2007-11-20 Thread AD.

On Nov 20, 5:59 am, John_Nowlan [EMAIL PROTECTED] wrote:
 I'd like to work on a pylons cms/wiki/plone/moin docs system. Not sure
 how much I have to offer, but the offer is out there.

I'm sure the Docudo guys could use all the help they can get.

http://groups.google.com/group/docudo/browse_frm/thread/2f3b841c589e888a

If Docudo 2.0 (based on TG2/Pylons) ever gets finished it might be a
suitable eat-your-own-dogfood replacement for Confluence that doesn't
distract Pylons development too much. Not that I have anything against
Confluence mind you (dogfood is overrated hehe).

--
Cheers
Anton
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Use Pylons environment from external Python script

2007-11-20 Thread Konstantin Alexandrov
Hello all.
I need to use my Pylons project's environment (config, models etc) from
external script launched by cron.
How to do that?
Thanks.

-- 
http://perceivingreality.com

--~--~-~--~~~---~--~~
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: Use Pylons environment from external Python script

2007-11-20 Thread Ian Bicking

Konstantin Alexandrov wrote:
 Hello all.
 I need to use my Pylons project's environment (config, models etc) from 
 external script launched by cron.
 How to do that?

If you use PasteScript trunk, you can do paster request config.ini 
/cron, which runs a request to /cron.

-- 
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
-~--~~~~--~~--~--~---



Integration of TIBCO AJAX Framework

2007-11-20 Thread Andrew Smart

Hi folks,

TIBCO offers a rich open source AJAX framework. I'm interested into
integrating this stuff into a Pylons application.

See:
http://www.tibco.com/devnet/gi/product_resources35.jsp?tab=downloads

Does somebody have experience with the TIBCO framework? Interested in
joining? 

Regards,
Andrew


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---