Alternatively, you can specify a template for a static directory to display all the files from the specified directory while you initialize the application
app = web.Application([ (r'/', IndexHandler), (r'/js/(.*)', web.StaticFileHandler, {'path': './static/js'}), (r'/css/(.*)', web.StaticFileHandler, {'path': './static/css'}), (r'/images/(.*)', web.StaticFileHandler, {'path': './static/images'}), ])
above code will display all static urls accordingly
<script src="js/jquery-1.10.1.min.js"></script>
will be mapped to /static/js dir,
(r'/js/(.*)', web.StaticFileHandler, {'path': './static/js'})
So, all the css and images to their respective cartographers,
(r'/css/(.*)', web.StaticFileHandler, {'path': './static/css'}), (r'/images/(.*)', web.StaticFileHandler, {'path': './static/images'}),
source share