Using Bootstrap and Tornado on Raspberry PI before you use this source code to run Tornado Web Server on raspberry, there are some installation things that need to be done first.
sudo apt-get update && sudo apt-get dist-upgrade
sudo pip3 install --upgrade pip
sudo pip3 install tornado
finally you can use this source code for you to control the relay or led according to the port initialization that has been configured on server.py and you just type on your browser localhost then Tornado web server work