Thanks Marin. I did check this, but my issue is that the same links are 
generated from both a website request and the internal script. The same 
module is used also in another domain. I wouldn't like to manually change 
the domain name for each application, as the scheme=True and host=True has 
worked so well.

On Saturday, February 15, 2014 5:53:57 PM UTC+2, Marin Pranjić wrote:
>
> As explained here:
>
> http://www.web2py.com/books/default/chapter/29/04/the-core#Absolute-urls
>
>
> You should use:
>
> URL(..., scheme='http', host='www.mysite.com')
>
>
> Marin
>
>
> On Sat, Feb 15, 2014 at 4:49 PM, Ykä Marjanen 
> <yka.ma...@gmail.com<javascript:>
> > wrote:
>
>> I got the scheduled background script working in PA. The script is 
>> started in web2py environment with -S app and -M -R parameters. The script 
>> generates emails, which include links (e.g. registration link with UUID).
>>
>> I use scheme=True and host=True to generate absolute URL. This works when 
>> I generate the emails directly from a website request. But when the 
>> scheduled script generates it in the background, the URL has local host 
>> (127.0.0.1) and not the real domain.
>>
>> I assume that because I generate the link in a background script, web2py 
>> instance lives in the local host and doesn't "see" the outside world (like 
>> when a website request happens).
>>
>> Should I just generate the domain manually, or do I have any better way 
>> to replace the localhost with the real domain?
>>  
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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