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
Hope it can be useful for someone,
Marco
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi