mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#fastapi

6 posts6 participants3 posts today

I've been able to work on Rack Root some more lately, and been spending a lot of time writing tests for the backend. At some point, I'm going to need to make sure I'm covering ALL the code paths, especially the ones that raise exceptions.

I didn't quite do test-driven development, but I do have most branches of the logic covered for a lot of scenarios. I'm up to 67 tests so far, but I'm sure I'll be over 100 once I add more functionality like associating IPs to devices.

For now though, I'm finally getting to write some of the frontend code to handle DHCP ranges on a given subnet. It does feel good to get back into that code.

It was absolutely trivial to get systemd's watchdog to handle my FastAPI server. I didn't know about these facilities, otherwise I'd have enabled it years ago. The "systemd-watchdog" package for Python takes care of all the details as long as I simply ping() it often enough.

Somewhat worrisome that my FastAPI server can sometimes just stop responding to requests. No errors in the logs, just timeouts for clients. Requires a restart and everything is fine again. No idea what goes wrong and fortunately it's pretty rare. Still annoying, as I expect servers to run for years unless stopped.

This screencast shows the result of a one day vibe coding session with #PyCharm #Junie and GPT-5...a small PoC for monitoring URLs, their response time and cert validity.

The complete #Python codebase has been generated. I did not touch a single line of code.

91% test coverage. The backend is backed by Sqlite...and it has a dark mode :)

Current project name is "Endpoint Pulse".

The primary purpose was building a PoC using vibe coding..

I have at long last returned to work on my #Python terminal server (#BBS) software. Did a fair bit of tidying up over the last couple of days. Preparing for an overhaul of the ORM, migrating from a dead project I chose when asyncio was still fairly new (Gino) to something that pairs better with my choice of #FastAPI for the web server code (sqlmodel). I have so many ideas, and it's easy to get sidetracked (which halts momentum toward an alpha release), but I've got a project board I've put together to try and keep me pushing forward.

github.com/haliphax/xthulu

Continued thread

Search results are working now, all the way through to the front end!

I was curious if I needed to worry about HTTP encoding/decoding of things like spaces/%20, but it looks like everything from the frontend to the backend is helping me with all of that. Search results are coming back as expected, though notably not partial string matches. To find the string DS414 for example, you need the whole DS414 and not just 'DS', which isn't the behavior I want. That'll be the next thing to fix.

I am also going to need to fix how the backend is talking to the database, which may mean fixing all of the fields to be lowercase/snake_case instead of camelCase. I discovered that when I was working on the triggers for finding these search results. My preference would be to name the database field somewhere in the Column(...) definition instead of refactoring most of my API calls, but we'll see what SQLAlchemy has for me there.

Then I'll add search support for networking/DHCP and I can get past this hurdle.

Acabo de terminar de revisar las 38 charlas que me han asignado para la PyConES de este año.

Mis conclusiones son:

- Hay un montón de charlas sobre IAs (para sorpresa nadie).
- Unas pocas escapan de las tendencias con el objetivo de explicar fundamentos: Cómo hacer un API REST, cómo trabajar con Django, etc.
- Bastante más de las que imaginaba giran en torno a la educación.
- FastAPI sigue estando de moda.
- Algunas sobre Django, pero mucho más sobre Django REST Framework.
- Ninguna sobre Flask.
- Una solo sobre testing y seguridad.
- Y ni sobre arquitecturas.

No puedo decir cuales son mis favoritas para no influir en la decisión del comité, pero me encantarían que fueran seleccionadas.

#pycones25 #python #django #fastapi