I am now using Django frame work to build a website which has the ability to control a remote embedded system (simply with functions like "Turn ON/OFF"). What i can image now is to use Socket Programming with Python (because Django is pure Python). As i have learnt, i only know how to send and receive messages with sockets between the client machine and server. 
Can any one tell me 
1. What else is needed to learn for this remote control function? 
2. Or is there any better ways (better frameworks) to implement this?
3. Dose Django have built in methods for Socket Programming? (If not, is it possible to implement it with self-defined app)?
You basically have one major thing to decide:

Is your embedded machine going to open up a port that allows any
thing that knows it's IP and port details to control it and your web
page write to that IP/Port OR
Is your embedded device going to poll the web app to find out which
state it should be in.

The first option will normally respond faster but your embedded machine will be more vulnerable to outside interference, you will need to be able to run active code on your web server, which a lot of servers do not allow, etc.
The second will only respond to state changes at an average of half the polling rate but will probably be simpler to program and manage.  Plus your server is not also acting as a client.
Remote control of an embedded system from Website