Hi Fabiano, Maybe to late. Here you have a full app based in python-rq:
https://github.com/josedesoto/web2py-rq-dashboard On Tuesday, 16 June 2015 19:15:03 UTC+2, Fabiano Faver wrote: > > Failed to copy the 2 error. The full traceback of the second error: > Traceback (most recent call last): > File > "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/worker.py", > line 558, in perform_job > rv = job.perform() > File > "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line > 495, in perform > self._result = self.func(*self.args, **self.kwargs) > File > "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line > 206, in func > return import_attribute(self.func_name) > File > "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/utils.py", > line 150, in import_attribute > module = importlib.import_module(module_name) > File "/usr/lib/python2.7/importlib/__init__.py", line 37, in > import_module > __import__(name) > File "/home/www-data/web2py/gluon/custom_import.py", line 85, in > custom_importer > modules_prefix, globals, locals, [itemname], level) > ImportError: No module named modules > > > > > Em terça-feira, 16 de junho de 2015 14:03:42 UTC-3, Fabiano Faver escreveu: >> >> I have tried to follow this tutorial: >> http://www.web2pyslices.com/slice/show/1579/web2py-and-redis-queue >> >> Just changed the arguments in the enqueue function to be fixed: >> def contato(): >> form = SQLFORM.factory(Field("name"), Field("message")) >> if form.accepts(request): >> # enqueue the email to be sent! >> job = q.enqueue(mail.send, >> to="som...@teste.com.br <javascript:>", # I CHANGED >> THE EMAIL HERE >> subject="test contacted you", >> message="message") >> # do whatever you want >> response.flash = "email successfully sent!" >> return dict(form=form) >> >> But it gives me a error. After some time I figured out it was asking the >> function name to be a string. >> >> Traceback (most recent call last): >> File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted >> exec ccode in environment >> File "/home/www-data/web2py/applications/OPM/controllers/default.py", line >> 1772, in <module> >> File "/home/www-data/web2py/gluon/globals.py", line 412, in <lambda> >> self._caller = lambda f: f() >> File "/home/www-data/web2py/applications/OPM/controllers/default.py", line >> 1750, in contato >> message="message") >> File >> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/queue.py", >> line 253, in enqueue >> job_id=job_id, at_front=at_front) >> File >> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/queue.py", >> line 215, in enqueue_call >> return self.enqueue_job(job, at_front=at_front) >> File >> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/queue.py", >> line 270, in enqueue_job >> job.save(pipeline=pipeline) >> File >> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line >> 461, in save >> connection.hmset(key, self.to_dict()) >> File >> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line >> 427, in to_dict >> obj['data'] = self.data >> File >> "/usr/local/lib/python2.7/dist-packages/rq-0.5.3-py2.7.egg/rq/job.py", line >> 227, in data >> self._data = dumps(job_tuple) >> File "/home/www-data/web2py/gluon/storage.py", line 56, in <lambda> >> __getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self) >> TypeError: getattr(): attribute name must be string >> >> >> But if i do it I get another error, but this time on Redis side about it >> could not import modules. >> >> ImportError: No module named modules >> >> Anyone had this problem? Couldn't figured out how to solve it. >> >> -- 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.