shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

267
active users

#fastapi

0 posts0 participants0 posts today
Adam ♿<p>Take me back to ASP.NET please.</p><p><a href="https://github.com/fastapi/fastapi/discussions/13449" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/fastapi/fastapi/dis</span><span class="invisible">cussions/13449</span></a></p><p><a href="https://aus.social/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://aus.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Linh Pham<p>Ooh, FastAPI now officially supports Python 3.13 with version 0.115.8!</p><p><a href="https://fastapi.tiangolo.com/release-notes/#internal" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">fastapi.tiangolo.com/release-n</span><span class="invisible">otes/#internal</span></a></p><p><a href="https://linh.social/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://linh.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Linh Pham<p>I guess there isn't an easy way of implementing RFC 2324 with FastAPI?</p><p>Adding a limited implementation to a Flask web application was pretty darn easy 😅 </p><p><a href="https://github.com/questionlp/stats.wwdt.me/blob/main/app/main/routes.py" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/questionlp/stats.ww</span><span class="invisible">dt.me/blob/main/app/main/routes.py</span></a></p><p><a href="https://linh.social/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://linh.social/tags/Flask" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Flask</span></a> <a href="https://linh.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://linh.social/tags/RFC2324" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RFC2324</span></a></p>
Luis Natera<p>I have been working with <a href="https://fosstodon.org/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> for around 1.5 years now, and one of the things that I miss most from <a href="https://fosstodon.org/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> is the community. Definetly will keep building my side projects in <a href="https://fosstodon.org/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> 100%</p>
Paolo Melchiorre<p>TIL secure.py 🔒</p><p>"Lightweight modern Python library to add security headers (CSP, HSTS, etc.) to Django, Flask, FastAPI, and more. Secure defaults or fully customizable."</p><p><a href="https://github.com/TypeError/secure" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/TypeError/secure</span><span class="invisible"></span></a></p><p><a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://fosstodon.org/tags/library" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>library</span></a> <a href="https://fosstodon.org/tags/security" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>security</span></a> <a href="https://fosstodon.org/tags/headers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>headers</span></a> <a href="https://fosstodon.org/tags/CSP" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CSP</span></a> <a href="https://fosstodon.org/tags/HSTS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HSTS</span></a> <a href="https://fosstodon.org/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> <a href="https://fosstodon.org/tags/Flask" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Flask</span></a> <a href="https://fosstodon.org/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a></p>
Aaron Longchamps<p>I'm learning a lot more about how Vue works and I am liking it a lot. I now have full CRUD operations on:</p><p>Get all items<br>Get single item details<br>Edit item (via HTTP PUT)*<br>Create new item and redirect to the new item's detail page<br>Delete item from the 'all items' page<br>Delete item from the single item details page</p><p>* I also wrote a new backend API for the HTTP PUT operation and associated tests. I already had HTTP PATCH /items/{id}, but that didn't work with my existing code for the front end. I think Vue has a good way to do this with watchers, but I don't have enough understanding of that yet to use it. Maybe that's next!</p><p>As I've been going through this, I really got a good understanding of how to write APIs, how to name fields, leverage JSON, and other fun things. I like how it's coming together in Vue and plan to keep going with it.</p><p>I'm not doing anything yet with error handling so I know I need to start incorporating that. I also want to take a look at the watcher mechanisms.</p><p><a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/vue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vue</span></a> <a href="https://infosec.exchange/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> <a href="https://infosec.exchange/tags/html" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>html</span></a></p>
Paolo Melchiorre<p>RT <span class="h-card" translate="no"><a href="https://fosstodon.org/@marcelotryle" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>marcelotryle</span></a></span> </p><p>Just released Starlette 0.38.3! 🚀</p><p>We now officially support Python 3.13, and <span class="h-card" translate="no"><a href="https://fosstodon.org/@adriangb" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>adriangb</span></a></span> fixed a bug in the BaseHTTPMiddleware. 🛠️</p><p><span class="h-card" translate="no"><a href="https://fosstodon.org/@FastAPI" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>FastAPI</span></a></span> users get this update out-of-the-box! 🙌</p><p>Have a beautiful Sunday, everyone! 💖👋</p><p><a href="https://github.com/encode/starlette/releases/tag/0.38.3" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/encode/starlette/re</span><span class="invisible">leases/tag/0.38.3</span></a></p><p><a href="https://fosstodon.org/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://fosstodon.org/tags/starlette" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>starlette</span></a> <a href="https://fosstodon.org/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://fosstodon.org/tags/asgi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>asgi</span></a> <a href="https://fosstodon.org/tags/async" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>async</span></a></p>
Aaron Longchamps<p>Success - this is the line that took me entirely too long to write today:</p><p>itemsAffected = db.query(Item).filter(Item.id == item_id).update(dict(**foo.model_dump(exclude_unset=True)))</p><p>with a database session<br>query the Item table<br>for rows that match my item_id<br>update them with properties present in object foo (which is of type ItemUpdate) as a dictionary</p><p>There might be a better way for me to do this, but I didn't find an example online that lined up closely with what I was trying to do.</p><p>I did not want to have repeating code where it was repeating this for every property or even a foreach loop doing something similar, that feels inefficient:</p><p>if db_item.&lt;field&gt; != input_item.&lt;field&gt;<br> db_item.&lt;field&gt; = input_item.&lt;field&gt;</p><p>The Pydantic ItemUpdate has two properties: name and description. The model for the ItemUpdate class defaults to None for everything not specified so you can pass in just { "name": "newnamehere" } and the description property will remain untouched.</p><p>Now I just need to write tests against this to make sure it's all passing properly!</p><p><a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a></p>
Aaron Longchamps<p>In my adventure to find a front end framework I like, I think I like Vue. I've seen a lot of FastAPI users use Vue, and even someone who said that's all they use with their FastAPI apps.</p><p>I have a basic list operation going here just pulling the JSON from the backend is working.</p><p>To test this some more, I'm going to make a page for individual items (so HTTP GET http://&lt;server&gt;/items/2) and see how I can render that.</p><p><a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/learning" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>learning</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/vue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vue</span></a></p>
Aaron Longchamps<p>Now I'm at the point where I'm working on a front end to my demo app and I have the basics of it working.</p><p>That being said, I think my testing might need to change a little bit since my response_model in FastAPI will be changing from a Pydantic type (Item) to HTMLResponse.</p><p>I think I'll be able to adapt those as needed with the parsing abilities in pytest, but we'll see how it works out.</p><p><a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a></p>
Aaron Longchamps<p>Tests are almost done, but that's definitely enough for tonight. I know pytest has a way, for example, to use an in-memory database so it's always empty and ephemeral, which would be perfect. But I'll figure that out in the morning.</p><p><a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/homelab" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>homelab</span></a></p>
Aaron Longchamps<p>That's probably enough coding for tonight. I got all the REST endpoints I think I need for now and have extremely basic tests written for them. The tests check the return code is 200 and the integer returned is the right number.</p><p>On the actual implementation of the functions, I'm returning some number that the test is looking for so I know I'm getting to the right function.</p><p>I am kinda curious if there's a test coverage tool that will tell me how much of my code is running when I run the tests. There's probably something in pytest for that which I can research another time. Rather than trying to hit 100%, I would use it to find out if I'm missing anything as I keep adding code.</p><p><a href="https://infosec.exchange/tags/python3" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python3</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/swagger" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swagger</span></a></p>
Aaron Longchamps<p>Tonight I decided to test out FastAPI and I have to say I've been able to get started faster than I was with Flask, and that includes writing tests.</p><p>The scope was to write the backend app, have some imported files, define API routes, and tests for those to make sure the basic test plumbing is working. After 15 minutes, I got it working and even have swagger docs auto-generated (which is built in to FastAPI).</p><p><a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/testing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>testing</span></a> <a href="https://infosec.exchange/tags/swagger" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swagger</span></a></p>
Paolo Melchiorre<p>Marcelo Trylesinski is giving the presentation "FastAPI Internals" during the EuroPython 2024 conference 🐍⚡</p><p>Info 👇<br><a href="https://ep2024.europython.eu/session/fastapi-internals" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">ep2024.europython.eu/session/f</span><span class="invisible">astapi-internals</span></a></p><p><a href="https://fosstodon.org/tags/EuroPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>EuroPython</span></a> <a href="https://fosstodon.org/tags/EuroPython2024" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>EuroPython2024</span></a> <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://fosstodon.org/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://fosstodon.org/tags/Starlette" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Starlette</span></a> <a href="https://fosstodon.org/tags/ASGI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ASGI</span></a> <a href="https://fosstodon.org/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> </p><p>CC <span class="h-card" translate="no"><a href="https://fosstodon.org/@europython" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>europython</span></a></span> <span class="h-card" translate="no"><a href="https://fosstodon.org/@marcelotryle" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>marcelotryle</span></a></span> <span class="h-card" translate="no"><a href="https://fosstodon.org/@pydantic" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>pydantic</span></a></span></p>
Linh Pham<p>For anyone using FastAPI or python-multipart, you may want to upgrade the version of python-multipart to &gt;= 0.0.7 or FastAPI &gt;= 0.109.1 (which includes a bump of required version of python-multipart). This is to fix a regex denial-of-service vulnerability.</p><p><a href="https://github.com/tiangolo/fastapi/security/advisories/GHSA-qf9m-vfgh-m389" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/tiangolo/fastapi/se</span><span class="invisible">curity/advisories/GHSA-qf9m-vfgh-m389</span></a></p><p><a href="https://linh.social/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://linh.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
True<p><a href="https://peoplemaking.games/tags/introduction" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>introduction</span></a> <br>Hi fediverse! This isn't my first time on Mastodon, but it is a new account.</p><p>I'm a queer writer and hobbyist game dev, currently working on a browser based RPG and maintaining a devlog on my blog.<br>I'm a big proponent of free and open source software, and am a leftist (not a liberal).</p><p>The game I'm making now is called Blasphemess and is based on <a href="https://peoplemaking.games/tags/Svelte" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Svelte</span></a> JS and <a href="https://peoplemaking.games/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> on <a href="https://peoplemaking.games/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> (so it's full stack work).<br>The game itself will hopefully provide lots of role-play and combat experiences similar to TTRPGs, but in an asynchronous way with less time investment needed from players. There's also the goal of having plenty of story writing, and a reactive setting to player choices and collective action.</p><p><a href="https://peoplemaking.games/tags/gamedev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>gamedev</span></a> <a href="https://peoplemaking.games/tags/gamedevelopment" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>gamedevelopment</span></a> <a href="https://peoplemaking.games/tags/IndieDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IndieDev</span></a></p>
Paolo Melchiorre<p>I published the article "μDjango (micro Django) 🧬" to illustrate this Django-based experimental project 🧪</p><p>I tried to give credit to all the people and projects that inspired it, trying to explain the process I <br>followed 💡</p><p><a href="https://www.paulox.net/2023/10/26/udjango_micro_django/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">paulox.net/2023/10/26/udjango_</span><span class="invisible">micro_django/</span></a></p><p><a href="https://fosstodon.org/tags/uDjango" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>uDjango</span></a> <a href="https://fosstodon.org/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> <a href="https://fosstodon.org/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://fosstodon.org/tags/Flask" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Flask</span></a></p>
Tim Wilson<p>I’ve been reading up on <a href="https://fosstodon.org/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> and <a href="https://fosstodon.org/tags/SQLModel" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SQLModel</span></a> in advance of starting a new project, and now I’m wondering what’s the best <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> library for creating a CLI client to my forthcoming API? What’s the current hotness? Is it just the standard requests library, or is there a different framework I should check out?</p>
Linh Pham<p>So... doing a clean install of FastAPI via pip will install the latest version of Pydantic (2.3.0) and good gravy does that break things badly!</p><p>Getting this lovely error message:</p><p>TypeError: To define root models, use `pydantic.RootModel` rather than a field called '__root__'</p><p>I ran into this when setting up a new virtual env on a new machine and ran pytest against the against. 🤦🏻‍♂️</p><p>I guess I'll have to pin the version of Pydantic to 1.10.12</p><p><a href="https://linh.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://linh.social/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://linh.social/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a></p>
Ada :v_trans: :v_pan:​<p>Some days I wish <a href="https://tech.lgbt/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> and <a href="https://tech.lgbt/tags/Flask" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Flask</span></a> died alongside Py2.7, that way the new generation of <a href="https://tech.lgbt/tags/Masonite" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Masonite</span></a> / <a href="https://tech.lgbt/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> could be adopted quicker.</p><p>But then I realize someone will use python 2.7 until either them, their company or both goes under 😞</p><p>A girl can dream....</p>