Is it possible to have this in web2py:
imagine i have a function for user registration:
after the db.auth_user.insert() i want to send an email to the user
I would like to have the sent_email() function in a spool, this way
the controller could execute faster and the emails would be sent in
create a task table with a email, title, message, and done fields.
insert a task in the table. Have a background process that selects the
first task with done=False, sends the email, sets done=True and loops.
On Aug 4, 10:02 am, Francisco Costa m...@franciscocosta.com wrote:
Is it possible to
That's what I do. I don't know how good this code is but it seems to work.
Happy to see any improvements.
auth.settings.register_onaccept.append(lambda form:
send_email(type='register', recipient=auth.user.email,
subject='Thanks for registering'))
=== model ===
# -*- coding: utf-8
thks Roberto,
tiago@tiago:~$ cd /opt/web2py/
tiago@tiago:/opt/web2py$ mkdir myspool
tiago@tiago:/opt/web2py$ uwsgi --socket :3031 --spooler myspool --
master --processes 4 --import mytasks --module web2py.wsgihandler
uwsgi: unrecognized option '--import'
On Jul 22, 5:47 am, Roberto De Ioris
Il giorno 22/lug/2011, alle ore 11:09, Tiago Moutinho ha scritto:
thks Roberto,
tiago@tiago:~$ cd /opt/web2py/
tiago@tiago:/opt/web2py$ mkdir myspool
tiago@tiago:/opt/web2py$ uwsgi --socket :3031 --spooler myspool --
master --processes 4 --import mytasks --module web2py.wsgihandler
I using 0.9.8.1.
How can i update to 0.9.8.2
thks in advance
On Jul 22, 10:15 am, Roberto De Ioris robe...@unbit.it wrote:
Il giorno 22/lug/2011, alle ore 11:09, Tiago Moutinho ha scritto:
thks Roberto,
tiago@tiago:~$ cd /opt/web2py/
tiago@tiago:/opt/web2py$ mkdir myspool
I using 0.9.8.1.
How can i update to 0.9.8.2
thks in advance
pip install uwsgi
(or pip install -U uwsgi)
Or download the sources from the official site and recompile them.
BTW we are getting a bit Off-topic i suppose we can move the discussion to
the uWSGI list (or the irc channel) and
I'M sorry Roberto for this boring question, but it gives an error in
web2py when i try to run the controller, and i don't know ao to solve
this.
Exception: you have to enable the uWSGI spooler to use the @spool
decorator
Thks in advance
On Jul 22, 5:39 pm, Roberto De Ioris robe...@unbit.it
How can i enable the spooler?
I have pass target='spooler' to the decorator args but it gives the
same error.
On Jul 22, 7:44 pm, Tiago Moutinho tiago...@gmail.com wrote:
I'M sorry Roberto for this boring question, but it gives an error in
web2py when i try to run the controller, and i don't
Hello Roberto,
I've tried to start web2py has you demonstrated:
uwsgi --socket :3031 --spooler myspool --master --processes 4 --
import mytasks --module web2py.wsgihandler
but I got this error:
[spooler directory] access(): No such file or directory [uwsgi.c
line 2994]
What
How can i create the spoller directory?
thks in advance
On Jul 21, 6:06 pm, Roberto De Ioris robe...@unbit.it wrote:
Hello Roberto,
I've tried to start web2py has you demonstrated:
uwsgi --socket :3031 --spooler myspool --master --processes 4 --
import mytasks --module
How can i create the spoller directory?
mkdir myspool
It is a normal, empty directory
thks in advance
On Jul 21, 6:06 pm, Roberto De Ioris robe...@unbit.it wrote:
Hello Roberto,
I've tried to start web2py has you demonstrated:
uwsgi --socket :3031 --spooler myspool
12 matches
Mail list logo