Exploring the Future Potential of AI-Enabled Smartphone Processors
Building a local web application with Flask
1. Building a local web application
with Flask
Mickaël Mendez - Tech Talk - December 21, 2016
2. Why would you develop a web
application ?
● Main goal: Summarize and Display information
● Share results with collaborators
● Promote your research
● Blogging
● Why not? Python makes it very easy!
3. What not to do
● Don’t write html tags within your Python
script. It will become impossible to read as the
project grows
● Don’t write URLs manually. It requires
unnecessary engineering to keep track of the
current location and format the links properly
4. Some Numbers
● 800 Lines of Code
● 450 Lines of Code
● 1500 Lines of Code (Test)
● 1000 Lines of Code (Test)
● 200 A4 pages of Documentation
● 140 A4 pages of Documentation
2011-2015
5. Instead use Flask
● Micro-framework for Python web development
● RESTful URL mapping
● Contains development server and debugger
● Flexible MVC design pattern (Jinja2)
● Very good documentation
16. Summary
● Flask helps generating a web application
○ Separate Python from HTML
○ Generate URLS
○ Lightweight - It does not store the web pages on disk
● Visualize and share your results
● Very well documented - maybe on of the best documentation
● Few dependencies
● Works with Python 3.3