Good day,
I have a question I have a website on Django, as when you start the web server to run a method that will listen to the specific port to stop the web server.
Maybe you need something like that? http://habrahabr.ru/post/133350/
You are going to use this in a real project, or so to indulge? Just how, I hear Django is extremely not recommended to use your server because of performance issues/security. So I would recommend to configure this feature from the front of the web server(Apache/Nginx)