How to get "paster request" to use config host value instead of localhost?

Posted by mmartinez on Stack Overflow See other posts from Stack Overflow or by mmartinez
Published on 2010-03-18T01:11:36Z Indexed on 2010/03/18 1:21 UTC
Read the original article Hit count: 359

Filed under:
|
|
|

I'm trying to access my pylons application via cron job to send notifications to my users. The way I'm doing this is by running the application using something like:

paster request myconfig.ini /maintenance/do

In the actual controller I check for the "paste.command_request" to block public access. Everything works but the only problem is that within the notifications that I send to my users there is a link to their profile and the host is "localhost" which should instead be the domain name of the application. When the notifications are sent from within the served application (say, a user modifies their settings on the site) the notifications have the correct url.

I am using mako to render my email tamplates and within the template I am using the "pylons.url" method with "qualified" set to "True".

Am I missing something here?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about python

Related posts about paster