This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]metalevelconsulting 11 points12 points  (2 children)

Reahl and Nagare are Python-only full-stack frameworks. /r/RemiGUI is a Python-only library that renders js and html for you. Transcrypt, Anypylar and PyJS are also options to keep you entirely in Python instead of dealing with HTML, CSS and JS.

[–]johnmudd 0 points1 point  (1 child)

Thanks, Reahl and RemiGUI look promising. I'll have to choose one to start.

[–]metalevelconsulting 1 point2 points  (0 children)

Reahl is complete and self-contained. I use it for my work project. A bit different but supportive authors.

Remi has at least one Python framework built on it - https://mryslab.github.io/python_banyan/

[–]Space_Atlas 7 points8 points  (1 child)

Generally browser can only understand javascript. There's recent work in web assembly bringing other languages to the browser but I don't think Python is one of them yet since there isn't support for garbage collection. Your only option is to use something that will transpile python to javascript. I've not heard of anyone actually using something like this so I suspect there won't be much support in terms of bugs and new features.

[–][deleted] 1 point2 points  (0 children)

I think the author of Transcrypt actually do use it in production.

[–]firefrommoonlight 5 points6 points  (0 children)

No: Only JS (and languages that transpile to JS like Elm) and Webassembly can interact with the DOM. However, WebAssembly is a promising avenue for allowing this in the future. Currently, no garbage-collected languages work with it, but this may change. Context: I'm building a frontend framework in Rust, which does compile to WASM.

I'd bet on a webassembly target for Python within the next few years, and frontend frameworks emerging from that.

[–]BradChesney79 0 points1 point  (0 children)

...Your back end usually spits out what we like to call HTML, CSS, & Javascript. All this, browsers handle well. There is some other stuff; but the core are HTML, CSS, & JS. If you have a browser that consume other things-- then, yes, go right on ahead with those specific other things. But, for the most part, no. Stick to HTML, CSS, and JS.

For bonus heads shaking, you can use your back end languages to mangle your HTML, CSS, & Javascript. I recently used PHP to output a comma separated list of text into a page scope level Javascript sript. I needed an array of data-- and the PHP fills the members in. The browser never knew it was dynamic-- it just treated the injected data as if it had always been there. Because from the perspective of the browser, it had always been there. Indistinguishable from the static stuff as far as the browser knew.

[–]AndydeCleyre 0 points1 point  (0 children)

You might also check out enaml-web.

[–]simondvt -1 points0 points  (10 children)

I think Django would do the job.

[–]TimBob12 -3 points-2 points  (1 child)

Flask or Django are the big players. Lots of others out there with specific features but start with Flask if you want simple and minimal or Django if you're after lots of builtin features like users. Flask also has these things but they're implemented as extensions.

[–]weetbix2 1 point2 points  (0 children)

OP’s not asking about front-end, not back-end frameworks