I'm trying to learn web programming in python, and have the following project in mind: mine the yahoo finance api for instrument data, and display it in real time, as well as plot charts based on instrument data.
I already did something similar using wxpython, and I'm interested in how I would accomplish this in a web application.
My first thought was to use django and matplotlib on the server, and have the client request updated chart images through jquery at a certain time interval, but after a bit of research I came upon libraries like twisted and tornado...and now I'm confused. Would they work better for this web app than django ?
After the above rambling, my question is: what library should I use for writing the web app i have in mind ? I'm also thinking that I should abandon matplotlib, and generate the chart on client side, but I'm not sure what javascript library would allow me to do that, if any.
Among these, Django is the most used. Well, Django and Flask represent two major categories of frameworks: full-stack frameworks and micro frameworks (sometimes called non-full-stack), respectively. If you need to develop a feature-rich system, it's best to choose one of the full-stack frameworks.
Flask. Flask is considered a microframework. It comes with basic functionality, while also allowing for easy expansion. Therefore, Flask works more as the glue that allows you to join libraries with each other.
What is a Python Web Framework? Python Web framework is a collection of packages or modules that allow developers to write Web applications or services. With it, developers don't need to handle low-level details like protocols, sockets or process/thread management.
Few tips:
1/ Do not plot your data at backend . Instead use the browsers to generate charts.I would recommend using jqplot, or highcharts.
2/ Yes, you can use tornado or twisted instead of django, as they are asynchronous servers, and would provide faster handling of requests.
3/ You should create a REST interface of your application, with server side only sending JSON data, and do all the UI templating and charting on client side.
4/ Backbone.js (recommended, but you can use some other MVC framework), would also prove to be helpful if your app grows too complex.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With