Flask-SQLAlchemy 3.1.0 released, with support for SQLAlchemy 2's new annotation-based model definition. Thanks to @pamelafox for becoming a maintainer and enabling that support!
https://github.com/pallets-eco/flask-sqlalchemy/releases/tag/3.1.0
https://pypi.org/project/Flask-SQLAlchemy/3.1.0/
#Python #Flask #SQLAlchemy
🌐 Chcete se naučit vytvořit jednoduché webové API? Přidejte se na workshopu "Moje první API ve Flasku", který povedou Miroslav Brabenec, Petra Číhalová a Lenka Erbenová! 👩💻 https://cz.pycon.org/2023/program/workshops/20/
#WebAPI #Flask #PythonWorkshop
#webapi #flask #pythonworkshop
Here's a #Flask architecture question:
I'm building out some routes to get and edit some database objects. These objects are children associated to a parent in a collection.
For the URL, is it better to have a hierarchical address like `/parent/<parent_id>/child/<child_id>` than to just do `/child/<child_id>`?
My thinking is yes because I can filter DB objects based on the parent ID and the associations which already exist, but then looking up a child directly is also fast. Thoughts?
The last couple of months I've been working on a little #rss reader that doubles as a (read-only) #mastodon client.
The UI is closer to a Mastodon/Twitter feed than an email inbox.
I'm still experimenting with it, and it's missing a bunch of basic stuff, but I did add some cool features already, like an embedded reader mode and a send to #kindle button.
It uses #python #flask for the backend and #htmx #hyperscript #bulma for the UI.
#rss #mastodon #kindle #python #flask #htmx #hyperscript #bulma
I officially finished to write the #backened of my web application for my #CS50 final project.
What a ride, in hindsight just a few months ago a couldn't believe I was gonna be able to design and build an app from scratch like this.
Now, on to the #frontend.
#backened #cs50 #frontend #python #flask #sql
Well, I think it could be nice to talk a bit about myself, so here it goes (it is a long one, be warned)
My (still ongoing) journey from engineering to programming: Prologue
As can be seen in my profile bio, my name is Iago Andrade, and I am a Brazilian. What can't be seen there, though, is that I'm a mechanical engineer, and I have worked as a mechanical designer since 2018. This year (2023) I decided to pursue an old desire, which was to be able to work with #programming.
First contact
From the very first year at university, I fell in love with programming, when we were introduced to #C. Most of my friends were not really interested in that, and thought it was too difficult, but I was fascinated by the possibilities of what could be done with it.
At first, we used it mostly to solve dificult mathematical problems through iterative process, but my curiosity led me to learn more than just what was taught in classes. We were also later introduced to MATLAB and EES, and I even learned a bit of #Python in order to help a friend of mine.
But as the course became more and more time consuming, I started to drift away from that passion, and focus more on the other disciplines, and only sparingly did I delve into anything related to programming.
First job
As I graduated, I soon got a #job in mechanical design, modeling industrial equipment and parts and its drafts for production. As I had little time for studying, programming was put aside for a while, and all the focus was put into this job.
I learned a lot at this job, and managed to build a lot of resources for accelerating, and even automating tasks, and that kept me reminded of how much I liked to solve problems like these. I even got to the point of learning some #bash script in order to automate the creation of folders in the company's server (which did not end up very well, due to the lack of some quotes hehe). Though the script caused some problems, it was solved in the end (and I learned the important lesson of debugging everything very thoroughly).
Reigniting an old passion
At some point between then and now, I learned of the existence of a "new" game engine called #Godot. I had never made any #games, and had never used a game engine before either, but I had had some contact with #FOSS (free and open source softwares), like #blender and #inkscape, and that one caught my attention, since I had always wanted to create games. Since it was free, super lightweight, I decided to give it a go. It felt so good to learn that tool, and programming in it reminded me of how much I liked to code.
Back then, a friend of mine was also interested in making a game, and he wanted to be more focused on the story part of it, which was perfect since I wanted to focus on the programming and possibly the art and music for it. We started to work on the idea, got a ton of references, and started building the overall scope and story, until one day we lost momentum and just couldn't get back to it. Our jobs were sucking too much energy, and we decided to put it aside until we had more time to do it properly.
#SQL and the leap of faith
After some more years of working with 3D modeling, the company where I was working decided to implement an ERP system. The problem was they didn't have anyone from the inside who was qualified for some of the tasks that would appear, and they tasked me with dealing with those problems.
I had never worked with an ERP system, but had some idea of how #databases worked, and that helped a lot in making some decisions early on (like not entrying all data manually). I had to learn how to bulk clean old data from another system they had used before, which had been fed by many different people, with a lot of mistakes and inconsistencies.
After that, I had to import all that data into the system, and I decided it was time to learn SQL so I could query the database properly when I needed information. And that once again triggered my interest in programming, leading to my decision to make new templates for the engineering team.
These templates used programming for automating some of the tasks, in a language specific for the modeling software,reducing many of the steps in the project pipeline, and making it easier to input new equipment in the system.
As I became more and more #tired of some problems at work, and got more interested in programming again, I made the decision of focusing in relearning the languages I had contact with, and while searching for resources, I was informed that #Harvard offered this course online, called #CS50
For a few months I tried, and was unable to #study in my spare time. So ultimately, I decided to #quit my job, finish CS50, and start a career in programming.
Paying the #bills
With only the final project from the course left, money was running short, and bills were still appearing, so I had to start looking for jobs, and I ended up getting another job in mechanical design. The difference now is that it is much closer to home, so I will be able to finish my final project on my spare time, and keep looking for #junior roles in programming.
Epilogue: The Final Project
Since this toot is ridiculously long already, I may as well talk about the final project for whoever got to this part haha
The idea for the project is to mix a bit of #gamedev with #webdev, making a site with three main areas containing mini-games in three different styles, from #ASCII to one with actual graphics. If all goes well, I also wanted to enable players to get a score, and keep that in a database, if the player so desires. #Backend is being done in python with #flask, #frontend is using templates from flasks #jinja, but mostly plain #HTML #CSS and #javascript
#programming #c #python #job #bash #godot #games #FOSS #blender #inkscape #sql #databases #tired #harvard #cs50 #study #quit #bills #junior #gamedev #webdev #ascii #backend #flask #frontend #jinja #html #css #javascript
Lumos got a new update. It cleans up a lot of things.
Quick before I start teaching for the day:
Anyone have experience with passwordless logins, particularly with #Python or #flask? I'm thinking about going that route for student logins so they don't have to worry about creating _another_ password and so I don't have to go through Google Identity OAuth verification hoops.
#python #flask #webdev #askfedi
Interested in setting up a single-serving #website with #nginx or #flask or some kind of #python app server on a small & cheap #EC2 #Linux instance or something. I haven't done this in a long time, and am curious/interested in learning about what the current "production standard" is these days. Got any tips?
#website #nginx #flask #python #ec2 #linux
Any recommendations for any easy to use #Javascript libraries I can use to create charts in a #Python #Flask app? I need to be able to plot multiple time series, with different sample times. Things like Charts.js and Frappe only seem to support having shared X axis points (labels). I'm now wondering if D3.js is my only option, but it looks like a monster.
Happy to launch my personal website www.geoscrub.org powered by #Flask and hosted on #PythonAnywhere #GIS #Python #SmallBusiness
#flask #pythonanywhere #gis #python #smallbusiness
Just merged a huge PR from @pgjones into Flask that separates out IO so that async Quart can share much more of Flask's implementation. One step closer to merging Quart into Flask! #Python #Flask #Quart https://github.com/pallets/flask/pull/5127
@slashtechno you’d need to;
1. cache and occasionally get the feed the the mastodon api(or rss)
2. Run a small api to get the cached contents (Maybe with #SlimFramework or #Flask )
3. Use something like #AlpineJS to fetch the content in the static frontend add it in the style you want.
#slimframework #flask #AlpineJS
Isn't the quite new? I only recently heard of it while searching for asyncio #Redis caching and using async Requests and #BeautifulSoup. Now, I see it everywhere.
Personally, I am am busy investigating some backend and API, and I have just been considering using #Go instead of #Python and #Flask
#Redis #beautifulsoup #go #python #flask
Besoin d'aide pour de l'optimisation de code en #python, réalisation de back-end en #flask ou #go, réalisation de d applications android en #python ?
Je suis disponible le soir et week-end en #freelance
Portfolio : https://rvier.fr/pages/portfolio
Aha! Cracked it! The database connection was being made in if __name__ == "__main__": and so importing the Flask app in Gunicorn was never going to work properly! Damn you, original author of this code!
Still, that's me unstuck so I'm glad it was something easy, even if it took me multiple days to spot.
New blog post: fetching NDJSON over streaming HTTP requests (using #Flask/#Quart on backend, and fetch with ReadableStream on frontend).
https://blog.pamelafox.org/2023/08/fetching-json-over-streaming-http.html
Love to see +187 -3027 as the change summary. This probably represents another speedup for Werkzeug on top of the 35% observed when everything was adjusted internally for 2.3, since all the deprecation checks are no longer done for each request https://github.com/pallets/werkzeug/pull/2768 #Python #Werkzeug #Flask