Use this when your Django development server just doesn't cut, and you're too lazy to install XAMPP/Apache.
I wrote this server when I started working with HTML5
So, I wrote this server, and added a URL redirect inside my Django app to serve all video content through CherryPy (instead of Django) ... and VOILA! Everything worked!
-
Install CherryPy:
pip install cherrypy
oreasy_install cherrypy
-
Make sure it's installed:
python -c 'import cherrypy'
-
You can edit the listening URL/port inside the source file.
-
The root directory is the directory where you executed the script.
Just execute the file on your shell/terminal: python cherrypy_static_server.py
What's 'name' in the serve_file method?