Difference between socket and websocket?

To answer your questions. Even though they achieve (in general) similar things, yes, they are really different. WebSockets typically run from browsers connecting to Application Server over a protocol similar to HTTP that runs over TCP/IP. So they are primarily for Web Applications that require a permanent connection to its server. On the other hand, … Read more

multiple django sites with apache & mod_wsgi

Your ServerName/ServerAlias directives are wrong. ServerName should be hostname. You probably should just delete ServerAlias. Then just do the obvious and duplicate VirtualHost/Listen directives, just changing the port number and locations of scripts in the file system. Finally, do not set DocumentRoot to be where your Django code is as it makes it easier to … Read more

Python : How to parse the Body from a raw email , given that raw email does not have a “Body” tag or anything

To be highly positive you work with the actual email body (yet, still with the possibility you’re not parsing the right part), you have to skip attachments, and focus on the plain or html part (depending on your needs) for further processing. As the before-mentioned attachments can and very often are of text/plain or text/html … Read more

Target WSGI script cannot be loaded as Python module

For me the problem was wsgi python version mismatch. I was using python 3, so: $ sudo apt-get remove libapache2-mod-python libapache2-mod-wsgi $ sudo apt-get install libapache2-mod-wsgi-py3 Warning from @alxs before you copy/paste these commands: If there are python 2 projects running on the server that use wsgi and apache, the above commands will effectively shut … Read more

Django stops working with RuntimeError: populate() isn’t reentrant

This is caused by a bug in your Django settings somewhere. Unfortunately, Django’s hiding the bug behind this generic and un-useful error message. To reveal the true problem, open django/apps/registry.py and around line 80, replace: raise RuntimeError(“populate() isn’t reentrant”) with: self.app_configs = {} This will allow Django to continue loading, and reveal the actual error. … Read more