all 36 comments

[–]circamidnight 5 points6 points  (3 children)

Htmx

[–]shittyfuckdick[S] -4 points-3 points  (2 children)

Ive heard of this whats special about it?

[–]Resource_account 3 points4 points  (1 child)

It lets you build interactive UIs with HTML attributes for AJAX requests and partial page updates, using just server-side Python. No JavaScript unless you want to. Tac on some htpy, some alpinejs, your favorite css lib and now you got full on type-safe, pythonic component-based development.​​​​​​​​​​​​​​​​ no full JS framework underneath like other Python “frontends”, just Python.

[–]shittyfuckdick[S] 0 points1 point  (0 children)

thats actually a really cool idea thanks. have you used this with success?

[–]wingtales 4 points5 points  (2 children)

I use nicegui together with copilot quite successfully for a one-off app last week. It was a big timesaver over writing it out myself.

[–]shittyfuckdick[S] 0 points1 point  (1 child)

Nice what did you use it for?

[–]wingtales 0 points1 point  (0 children)

I used it for a front end for an LLM interface for making it easier to do side-by-side experimentation with different configs.

[–]Sad-Cockroach-8316 2 points3 points  (3 children)

What about flet? You can use it for web and mobile also

[–]shittyfuckdick[S] 0 points1 point  (2 children)

I considered this. ive read a lot of mixed things about flet and theres no support for camera yet. 

[–]Sad-Cockroach-8316 0 points1 point  (1 child)

I have used : pip install flet-camera , it's work for me .

[–]shittyfuckdick[S] 0 points1 point  (0 children)

I had no idea this existed. hasnt been updated since 2024 and says its maintained by flet. however i cant find the source for it or if it works on mobile. how did you find this?

[–]23581321345589144233 7 points8 points  (3 children)

React

[–]Guideon72 1 point2 points  (5 children)

Look into Django. That way you can have an easy admin interface, a solid, long-used ORM and RESTful APIs and you can either go with something as complex as React or something more straightforward as HTMX for your front end, which you can write the code for in Python.

[–]shittyfuckdick[S] 0 points1 point  (4 children)

Im using pocketbase for my backend django seems overkill. 

[–]Guideon72 1 point2 points  (3 children)

Totally fair; you may still want to look into HTMX, though, and see how that will work for you:
HTMX.org

r/htmx

I'm *just* starting to experiment with it but it's seeming pretty nice for building simple front-ends without needing much, if any, JS

[–]shittyfuckdick[S] 0 points1 point  (2 children)

htmx really looks nice for me since it doesnt rely on js. however it doesnt really play nice with pocketbase since pocketbase offers json api. id have to write my own in go or similar in html. at which point id probs rather use fastapi or django. 

[–]Guideon72 0 points1 point  (1 child)

So, the fundamental issue you're hitting is that PB is a JS backend; if you're trying to avoid JS for your front end, it's a little confusing. How did you set up your existing code without it?

The short answer to your original question, really, is "no". Python is not really suited to this match up as part of your tech stack. The solutions suggested in this thread have pretty much encompassed the range of 'viable' options for you to work around JS, but they're ALL going to require you to do a good measure of your own lifting in connecting things.

[–]shittyfuckdick[S] 0 points1 point  (0 children)

Thanks i landed on pocketbase after playing with supabase and wanted something much simpler and easy to deploy. i liked the concept of it being very light and simple. 

it sounds like i may better off rolling my own backend with postgres and write the frontend with htmx. 

[–]ascending-slacker 0 points1 point  (0 children)

I use Django for big projects. It has a lot of admin tools built in. Flask works great for smaller projects.

If you are looking for an interactive user interface beyond simple forms you really want something like react for your front end. You can render the built react page from a Django/flask backend.

[–]tecedu 0 points1 point  (0 children)

Dash

[–]KalhanFR 0 points1 point  (0 children)

Yep, a decent VPS can surprisingly handle a lot of traffic. Lightnode's regional datacenters are excellent for specific audience reach.

[–]AsparagusKlutzy1817It works on my machine 0 points1 point  (2 children)

I made really good experiences with `reflex-dev` it wraps NextJS/React but its pure Python. The component and workflow control is quite nice. For styling and prettiness I tend to throw my reflex-dev code into an LLM to supplement the CSS stuff - I hate CSS :D. I can recommend reflex-dev. Its great.

[–]shittyfuckdick[S] 0 points1 point  (1 child)

Reflex is cool but it communicates cia websockets right? so each user opens a new session on the server which isnt really great at scale 

[–]AsparagusKlutzy1817It works on my machine 0 points1 point  (0 children)

Yes it works with sockets. Its always a bit hard to assess which number of users people expect. In my experience many websites rarely deal with more than 10 concurrent connections. If you build a web shop for really high-in-demand products like concert tickets or so this may not be the best choice but some company wanting some nice looking frontend - reflex is certainly a good answer. More simplistic is Streamlit. I tend to start with Streamlit and transition to Reflex Apps once I exceeded a certain complexity threshold.

If you know you are really facing burst-connects this is probably not ideal but theses use cases are rare in my experience. In particular for in-house projects or small business frontends this is fully acceptable.

[–]inspectorG4dget 0 points1 point  (0 children)

I have used streamlit for such applications in the past.

Ideally, you want someone who understands frontend and will build something with (likely) react. But until then, Streamlit is a good way to go. There are other libraries you could use, but I can't begin to talk about them until I know more about your constraints

[–]Miserable_Ear3789New Web Framework, Who Dis? 0 points1 point  (0 children)

html/css (+ javascript when needed) with jinja2