I recently have changed the server for some Django/Python sites and immediately I got into trouble. My Apache instance or the WSGI daemon simply dies! No logs, no warnings or errors. I have to restart the Apache as root and I'm thinking is a serious permissions flaw somewhere. My Linux knowlegde is limited and aparently I'm the only one who had this problem, because I cannot relate to other answers I've found so far.
The WSGI version is 3.3 (multiprocess = True and multithread = True), Python 2.7 and Django 1.4 on a Debian machine. Some of the python libraries I needed, Django included, didn't come from the Debian's repository; I had them installed "manually".
Sometimes, I dont know if it is important or not, I get this error:
"ImportError: Failed to import _strptime because the import lockis held by another thread."
Read:
Make sure you are not loading mod_python at same time.
Ensure you are using mod_wsgi daemon mode and not embedded mode.
Force application to run in main interpreter application group.
The _strptime issue is a Python bug (only fixed in 3.3). Explicitly import _strptime module at the start of the WSGI script file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With