I’m importing a library with my code that gives me the
NotImplementedError: gevent is only usable from a single thread
the library is internal so I can’t share it unfortunately.
I managed to solve this for the Django development server by adding:
import gevent.monkey
gevent.monkey.patch_all(signal=False, httplib=False)
as the first two lines of my manage.py file after the shebang. Then I got to deploying it on apache with mod_wsgi and tought that it would be enough to have it as the first two lines of my wsgi.py-file. This was wrong. I think I’ve tried everything now, does anyone have any idea of what to do?!
Any ideas of a file that is executed before the wsgi.py file where I could try the monkey patch?
I did not manage to solve this problem, but I managed to replace the two gevent client to other client types which made the problem go away…