Hello,

Il 10/05/2012 14:33, Marco De Paoli ha scritto:
When you execute your python files outside uwsgi context (ex. for test
purposes) you are not able to import uwsgidecorators module
Because you get an ImportError: No module named uwsgi
This could be annoying.
I use a little trick to get out of this.
(The code refers the spool decorator but you can get the idea and apply it
to the others)

try:
     from uwsgidecorators import spool
except ImportError:
     def spool(f):
         f.spool = f
         return f

This way, when you test, you can make the same call but obtaining a
synchronous behaviour in place of a deferred one.
Obviously, in production (when you are running in uwsgi "shell") you obtain
the uwsgi standard deferred behaviour

I don't know how it would behave in your specific case but you can also take a look at contrib/upython, see:
http://www.mail-archive.com/[email protected]/msg02994.html

cheers,
riccardo
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to