joxean, to python Basque
@joxean@mastodon.social avatar

I want to create a web service in Python. I have almost always used web.py for doing so, but I have read good things about flask. What do you recommend me?

sergi, to random
@sergi@floss.social avatar

This question has been in my head these past few days, so I finally decided to post it on the official support channels. If by any chance you know the answer, please let me know!

https://github.com/sqlalchemy/sqlalchemy/discussions/10392

davidism, to python
@davidism@mas.to avatar

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://pypi.org/project/Flask-SQLAlchemy/3.1.0/
https://github.com/pallets-eco/flask-sqlalchemy/releases/tag/3.1.0

einenlum, (edited ) to random French
@einenlum@fosstodon.org avatar

Python is getting incredibly popular.

You're a senior dev and want to quickly learn ? Don't want to start from the basics?

This is for you!
https://www.einenlum.com/book

No bullshit. We focus on what's different between both languages and start from what you know as a senior dev. Learn the Python mindset and tooling. Great resource to then be able to learn , or .

What are you waiting for?

matdevdug, to golang
@matdevdug@c.im avatar

Rewriting parts of a app to use to allow me to import . It’s actually been extremely pleasant. I get most of the speed advantage of Go but I get to still use my favorite framework with flask.

I’m not sure if this is the “best” way to write modern web apps but it has been very fast to write v1, profile it under actual production load, find the problem areas and rewrite.

Tipa, to javascript
@Tipa@gamepad.club avatar

front end served by , written in with 3 game engine, back end served with (soon AWS ) and written in . There's a lot going on but it sorta works. This proves my idea to offload the processing to a remote back end driving a thin client works.

It plays terribly at the moment, but it's good enough to work on the UX.

brianb, to python
@brianb@fosstodon.org avatar

Here's a 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?

facundoolano, to mastodon

The last couple of months I've been working on a little reader that doubles as a (read-only) 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 button.

It uses for the backend and for the UI.

https://github.com/facundoolano/feedi

davidism, to python
@davidism@mas.to avatar

I'm interested in doing some livestream maintainer office hours for Flask and the Pallets ecosystem. Are there any hashtags on Mastodon related to that, where I can follow others doing it and get more reach when I start?

sergi, to random
@sergi@floss.social avatar

Jinja2 Fragments 1.0.0 is out!
https://pypi.org/project/jinja2-fragments/1.0.0/

Check it out if you use something like that benefits from template fragments.

hl, (edited ) to javascript
@hl@social.lol avatar

Any recommendations for any easy to use libraries I can use to create charts in a 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. It's for this project: https://www.henryleach.com/2023/03/home-sensor-network-part-1-the-plan/

connorshea, to random

I've been working on a small tool that makes it a lot easier to create tracklists for albums on @wikidata!

Essentially, you pick an album to edit, input your tracklist (with optional duration and ISRC), plus some other optional metadata like the producer, recording location, and performer, and then it'll automatically create the track items and tracklist statement for you.

https://multitrack-drafting.toolforge.org

Thanks to @moebeus for the help figuring out how the tool should work :)

GeoScrubJohnL, to python

Happy to launch my personal website www.geoscrub.org powered by and hosted on

davidism, to random
@davidism@mas.to avatar

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! https://github.com/pallets/flask/pull/5127

mekuso, to python
@mekuso@fosstodon.org avatar

Today's Python hot take: FastAPI is one of those sarcastic names, like Greenland (which isn't very green). The devs' claims of it being fast is some kind of joke. Because it's not actually very fast at all. A replacement package that's actually fast is Litestar, which also seems generally more wholesome.

Stark9837,
@Stark9837@techhub.social avatar

@mekuso

Isn't the quite new? I only recently heard of it while searching for asyncio caching and using async Requests and . Now, I see it everywhere.

Personally, I am am busy investigating some backend and API, and I have just been considering using instead of and

@Python

pamelafox, to random
@pamelafox@fosstodon.org avatar

New blog post: fetching NDJSON over streaming HTTP requests (using / on backend, and fetch with ReadableStream on frontend).

https://blog.pamelafox.org/2023/08/fetching-json-over-streaming-http.html

davidism, to python
@davidism@mas.to avatar

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

davidism, to python
@davidism@mas.to avatar

Werkzeug 3.0 will remove our modified, difficult to maintain copy of the built-in urllib.parse module. It also removes support for bytes where strings are expected, an artifact of Python 2+3 compat. These are huge changes, there's deprecation warnings all over the place in 2.3. And yet we've received no comments on the warnings yet. Remember to treat warnings as errors during testing! I'll probably make a prerealease as well.

johnbeers, to django
@johnbeers@mastodon.social avatar

Ugh! Why is there so little information about setting up to use templates? Is it that uncommon?

johnbeers,
@johnbeers@mastodon.social avatar

I've now ported from a CLI thing to to ...and now to . All because I want to create a social asynchronous web app for a strategy board game I invented. Talk about scratching an itch.

davidism, to random
@davidism@mas.to avatar

Getting the Pallets Community Ecosystem set up. https://github.com/pallets-eco Similar to Jazzband https://jazzband.co, this is a place to collect important Pallets/Flask/Click/etc extensions and allow community write access and easier publishing workflows. Still figuring it out. If you are interested in getting a project in, or contributing to a project, please reach out on the Pallets Discord server https://discord.gg/pallets.

Stark9837, (edited ) to Youtube
@Stark9837@techhub.social avatar

"Why We Left The Cloud"

Recently watched this video by on , and his hot-take 🔥 was that they were using , and half of their pain was caused by this.

I have no experience with Ruby at all and most probably won't even recognize it if I were to read it.

If Ruby is such a bottleneck and inefficient, why did :mastodon: use Ruby for its implementation?

I know Ruby is often praised for servers and backends, especially APIs, but we have many solutions for this in :python: , which I wouldn't recommend, but :golang: and .

Does anyone have opinions or sources for this statement?

Video: https://youtube.com/watch?v=6h4oiPwtwDk&feature=share

Original article:https://world.hey.com/dhh/why-we-re-leaving-the-cloud-654b47e0

Stark9837,
@Stark9837@techhub.social avatar

@mo8it @badrs

I like and :golang: for backends. For simple personal prohects, :python: and are great. The development process is fast, I can push it out under hours. But I wouldn't use it for mission critical systems!

Stark9837, to python
@Stark9837@techhub.social avatar

Python import: Advanced Techniques and Tips

I thought I knew #Python until I read this. The plugins' functionality was quite interesting, and I have a few ideas about what I can use it for. One thing I miss in Python that I often use is in #CPP are true abstract classes, overloading, and extension of classes. With tools like this, you can achieve similar functionality.

https://realpython.com/python-import/#example-use-data-files

#coding #development #opensource #realpython

Stark9837,
@Stark9837@techhub.social avatar

@diazona @nobodyinperson

My first introduction to plugins was with , which really made its plugin system very easy. It is such a great project to develop plugins for. They did it with . I've been wondering if I should use something similar.

Stark9837,
@Stark9837@techhub.social avatar

@diazona @nobodyinperson

Here is the tutorial:

https://docs.octoprint.org/en/master/plugins/gettingstarted.html

Here is the basic concept of how it uses mixins:

https://docs.octoprint.org/en/master/plugins/mixins.html

The mixins make it quite easy to extend specific functionalities on events. It was really cool how they did it. is built with and uses the blueprint system of Flask.

.

cathodion, to django
@cathodion@mastodon.sdf.org avatar

second flask project, and my feeling is that by the time you need multiple files, which happens sooner than you think, you may as well have used django for the structure and nicer orm

sergi, to python
@sergi@floss.social avatar

@hynek I know you have some snippets about using with on the docs, bu do you know of a sample repo with something like "this is a sample Flask app with everything set up to show basic request information on stdout and/or a log file using structlog"? Extra points if it has configuration for .

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines