Add a Python web server on the fly to our project

If you are on linux / OsX or inside a phyton environment you can start a web server on the fly inside your project simply recalling an alias from the terminal in your project folder.

You have to edit your bash profile and add the following line:

alias server='open http://localhost:8000 && python -m SimpleHTTPServer'

This feature is very useful when you are working in local host with a browser that disables the origin load by default (i.e. Chrome).

inserted the alias inside the .bash_profile, refresh with the following command:

$ source ~/.bash_profile

inside your project folder you just type $ server to open your web server.


Programmer by day and mostly by night as well.