Hello mark! thanks for you answer.

Your approach sounds really nice, but exactly how you run a cron task 
inside web2py environment? you start the web2py client with the console 
option and there execute the task? may you give me an example of this?

El domingo, 4 de octubre de 2015, 8:31:20 (UTC-4:30), Mark Graves escribió:
>
> Luis,
>
> I've never personally used celery to queue tasks to execute in a web2py 
> environment.
>
> I found myself in a similar situation recently and just used a cron task 
> running a python script in the web2py environment from the command line.
>
> Is there a particular reason this workflow would not work for you?
>
> -Mark
>
> On Saturday, October 3, 2015 at 10:40:47 AM UTC-5, Luis Valladares wrote:
>>
>> But how can you exec a web2py task (who may uses web2py internal 
>> components like Request, response, db, etc..) with a external celery app? i 
>> mean, if i wish to execute a task, for example: To insert a new register in 
>> a table of my web2py database, and in enqueue this task to a remote (or 
>> local) celery worker to do it, how i can get this worker to know about all 
>> the "environment" of web2py? the only idea i have its creating a worker 
>> that is aware of the web2py environment, but i dont know how to do this.
>>
>> There is anyway to use celery queue to execute tasks that requires the 
>> web2py environment?
>>
>> El viernes, 2 de octubre de 2015, 5:46:35 (UTC-4:30), Niphlod escribió:
>>>
>>> I'd say you're loosing yourself in a glass of water. In order to 
>>> schedule something, that something must work. If your "something" doesn't, 
>>> it really doesn't matter what tool are you issuing commands to.
>>>
>>> On Friday, October 2, 2015 at 11:56:55 AM UTC+2, Stefan van den Eertwegh 
>>> wrote:
>>>>
>>>> Hi Niphlod,
>>>>
>>>> Thanks for you answer.
>>>>
>>>> Why i am asking this is because i want to generate around 150 pdf's by 
>>>> weasyprint and per each pdf i want to queue a mail with it as an 
>>>> attachment.
>>>> Could this be done by the build in web2py Scheduler?
>>>>
>>>> PS: i tried the scheduler, but it tries to use the generic.html view 
>>>> but has not enough settings provided in the layout.html to use it, it 
>>>> fails.
>>>> is is not so that it executes the function from the model with database 
>>>> privileges and not uses a view? Or is it also using the default generic 
>>>> view?
>>>>
>>>> Thanks for responding!
>>>>
>>>> Best regards,
>>>> Stefan
>>>>
>>>> Op vrijdag 2 oktober 2015 11:21:07 UTC+2 schreef Niphlod:
>>>>>
>>>>> you won't ever get to start workers from web2py, either with the 
>>>>> embedded scheduler, with rq or with celery.........that's pretty much a 
>>>>> requirement (being completely separated)
>>>>>
>>>>> PS: celery integration was done on a so old release of celery that it 
>>>>> won't ever be production ready
>>>>>
>>>>> PS2: you don't need any web2py plugin to push task to celery.
>>>>>
>>>>>
>>>>>

-- 
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/d/optout.

Reply via email to