art_codesmith,
@art_codesmith@toot.cafe avatar

After a bit of playing with , I feel like it's really, well, API-oriented. You can have templating of course, but it's just a liiiittle clumsier than returning JSON (e. g., you need to manually inject the request into it).

So I'm not entirely sure if I should stick to my original plan of mostly rendering HTML and using , or if I should go with the framework flow and make a app. Probably the latter TBH.

sergi,
@sergi@floss.social avatar

@art_codesmith what are your requirements for the backend framework? Any reason to discard Flask or Django?

art_codesmith,
@art_codesmith@toot.cafe avatar

@sergi None other than I wanted to look at FastAPI (and async frameworks in general).

sergi,
@sergi@floss.social avatar

@art_codesmith got it. Got it. Yeah, I haven't had the opportunity to dabble with a native async framework before, something I also want to try. You might want to check out some of the ones listed on https://github.com/sponsfreixes/jinja2-fragments like Quart or Sanic to get a feel of how they use templating.

_chrismay,
@_chrismay@fosstodon.org avatar

@art_codesmith This is why I switched from FastAPI to Starlette for most of my projects. It has the stuff I care about without the JSON-ification of all the things I don't.

That said, FastAPI can be configured at a more global level to return HTML.

https://fastapi.tiangolo.com/advanced/custom-response/#default-response-class

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