In this demo / code walkthrough video I will show how to:
- Use SQLAlchemy's automap feature to connect to a DB.
- Use HTMX to make Ajax calls to various Flask endpoints.
- Make a nice line graph using Chart.js
Code repo:
github.com/bbe...
Mentioned/ related links and tools:
- SQLAlchemy's automap feature: docs.sqlalchem...
- The graphing code I got thanks to this article: "Graphing Pretty Charts With Python Flask and Chartjs" - blog.ruanbekke...
- You might want to get into htmx, a powerful library that lets you make ajax calls from HTML (no JS code needed!) - htmx.org
- DB Browser for SQLite: sqlitebrowser.org
- Mockaroo is a great service / tool for generating fake data: www.mockaroo.com
- Managing environment variables in Python: pybit.es/artic...
- How to run a Flask app: flask.palletsp...
- Use Python's zip builtin to transpose a list of tuples (e.g. dict.items()) into a list of x and y values, a handy technique for plotting: / 1434453201340731395
----------------------------
There's plenty more to discover with PyBites:
Check out our Python tips book: pybit.es/tips
You can also subscribe to receive weekly Python / Career / Mindset tips straight to your inbox here: codechalleng.e...
To work with us 1:1 to develop that complex project you've always wanted to build, check out our coaching program: pybitesdevelop...
If you'd prefer to listen to us on the go, we discuss the mindset crucial for a successful developer on our podcast: www.pybitespod...
Visit us at pybit.es to find out how we can help you on your Python journey.
Also we'd love to hear what you want more training and content on, just comment below or send us an email at info at pybit.es!
Негізгі бет Plotting database tables using SQLAlchemy automap, Flask, htmx and Chart.js
No video
Пікірлер: 11