External Link stackoverflow.com After struggling to get dependencies inside of middleware I learned that you can make global dependencies at the app level. I used this to set the user on every single route of the application without needing Depend on getting the user on each route.
Posts tagged: thought
All posts with the tag "thought"
883 posts
latest post 2026-08-08
Publishing rhythm
Handling Errors - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com This page shows how to customize your fastapi errors. I found this very useful to setup common templates so that I can return the same 404’s both programatically and by default, so it all looks the same to the end user.
logs with FastAPI and Uvicorn · Issue #1508 · fastapi/fastapi Hello, Thanks for FastAPI, easy to use in my Python projects! However, I have an issue with logs. In my Python project, I use: app = FastAPI() uvicorn.run(app, host="0.0.0.0", port=8000) And when... GitHub · github.com Setting an additional log handler to the uvicorn logger for access logs in fastapi was not straightforward, but This post was very helpful.
External Link stackoverflow.com Here is a full example from the post.
waylon walker (@_WaylonWalker) on X Bloggers where do you put your markdown? X (formerly Twitter) · twitter.com Most bloggers on my twitter blog right into a file that goes on git. I kinda expected to have more database folk. I have my blog in markdown on git and the editing experience is top notch. I can just find files edit them in MY EDITOR, push them and I got a post. I am running thoughts in a sqlite database with a fastapi backend, and holy crap the instant nature of posting feels so much better. Both sides have good points.
Show some equivalent list comprehensions in filter examples · Issue #1068 · pallets/jinja I'm willing to write a pull-request for this, but I just want to see what people think before I write it. So the issue is this. I'm very familiar with python. I'm new to Jinja2. Often I find myself... GitHub · github.com I often want to reach for non existing list comprehensions in jinja 2, Here are a few nice equivalents.
External Link vi.stackexchange.com I fixed my missing macro recording indicator that I lost and was never quite sure why. (because I forgot that I set cmdheight=0).
GitHub - DataDog/ddqa: Datadog's QA manager for releases of GitHub repositories Datadog's QA manager for releases of GitHub repositories - DataDog/ddqa GitHub · github.com DataDog ddqa is building out a textual app and deploying it with pyapp. They have CI setup to fully build and cross compile their textual tui into github releases that you can just download from their releases page. This is something I am looking at for markata. This would be pretty sweet to be able to make it just work on places like windows. It would also be interesting to try to build a full desktop app with pyapp.
Full list of imagemagick color names.
Adam Wathan (@adamwathan) on X Hear me out. X (formerly Twitter) · twitter.com I’m going to give this trick a shot on my sites, and see how I like it. Down in the comments @adamwathan goes on to say. Basically every layout overflow bug ever boils down to some flex or grid child needing min-width: 0 😄 Oh and @ryanflorence also says in the comments. I … do this.
External Link tushar.lol Nice message by @tusharsadhwani. Write it down. You had to dig deeper than face value at something. Write it down. You had to combine multiple pages of docs. Write it down. Someting was simply not obvious to you at first and it took someone else to give you that ah ha moment. Write it down. You had a small discovery that had a marginal impact on your day. Write it down. A blog does not have to be a Blog, it can be small meaningful posts. There are absolutely no rules. If you think you are going to end up with too many posts, that is a solvable problem, make a search, curate your favorite posts, make multiple feeds. At the end of the day. Write it down. This post itself is a thought, the smallest component to my blogging strategy. Write it down.
Path Operation Advanced Configuration - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com From the Docs # trailing slash # I’ve had better luck just routing both naked and trailing slash routes in fastapi. I’ve had api’s deployed as a subroute to a site rather than a subdomain, and the automatic redirect betweens them tended to always get messed up. This is pretty easy fix for the pain is causes just give vim a yyp, and if you don’t want deuplicates in your docs, ignore one. favicon.ico # Now you do not need to deploy favicons to your api in any way, it is nice to have it in your browser tab, but more importantly to me I hate having console errors that are meaningless, this gives the browser something to automatically grab and not log errors.
Protect API docs behind authentication? · Issue #364 · fastapi/fastapi Basic Question Does FastAPI provide a method for implementing authentication middleware or similar on the docs themselves (e.g. to protect access to /docs and /redoc)? Additional context My company... GitHub · github.com You can protect your fastapi docs behind auth so that not only can certain roles not run certain routes, but they cannot even see the docs at all. This way no one that shouldn’t be poking around can even discover routes they shouldn’t be using. Here is the soluteion provided by @kennylajara
Cancel subscriptions Cancel subscriptions immediately or at the end of the subscription period with proration options, invoice handling, and automatic cancellation after failed payment attempts. stripe.com This is a handy guide to cancelling stripe subscriptions. You can even inverse it by flipping to and re activate the subscription.
External Link stripe.com You can find your customers next billing date through the stripe api by using. and passing in customer, customer_details, subscription, or schedule. Within the invoice, you can find the next_payment_attempt as a epoch.
Search Use the search APIs to look up and retrieve objects in your Stripe data. Using search is a faster alternative to paginating through all resources. stripe.com Stripe has it’s own query language for querying data. I’m just getting into using it and it seems pretty good so far. I needed to lookup the price for products. I was able to find prices for my product using the python api as shown below.
stripe-keys-and-ids.tsv tsv Stripe has so many keys and ids this is a very helpful list to decode what exactly an id is for.
Dang this is such a good message. I can’t exactly relate to being forced into the overworking situation that PirateSofware is talking about. I can relate to being conditioned to feeling a certain way and changing that is very difficult. I can also relate to not feeling like I am getting enough done in the day. Sometimes a bit of separation is good.
External Link stackoverflow.com Get those print colors exact
page-break-after CSS property - CSS | MDN The page-break-after CSS property adjusts page breaks after the current element. MDN Web Docs · developer.mozilla.org I’m working on something that might go to print, so I want the page breaks to happen somewhat in my control as the content author. As I do my writing I break my content up in to many short sections using h2, sometimes an h3. These are generally short sections that go together, should stay together, and typically are not too lengthy to cause a large white space in print. I found a way in css to only allow page breaks to happen on h2 and h3, and it turned out perfect, suck it WSIWIG editors