Home > front end >  Replacing Javascript with Python
Replacing Javascript with Python

Time:10-10

Is it possible to make a website using HTML/CSS with Python instead of JavaScript?

CodePudding user response:

If you mean on the backend, yes, of course. see flask and django projects.

CodePudding user response:

Python in any way could be a replacement of javascript and and vice versa.

If your web don't need a visual effects, don't need data from Rest Apis, is just and html with css, the answer is: You could create the html in the server using python

If you web need a lot the classic effects, open/close popups, left hamburger menu and more complex features in the client side (browser), the answer is: No, you can't develop it without javascript

There attempts to create a web effects with pure css, but is not common.

Server Rendering vs Client side Rendering

In web development there are two approaches to deliver content to end users: Server rendering and client side rendering

Server side rendering (SSR) — the traditional rendering method, basically all of your page’s resources are housed on the server. Then, when the page is requested (commonly from web browsers), the Html, JS and CSS are downloaded. Also frameworks can dynamically can create the html based on backend logic and finally download it. At this point, a lot of frameworks offer wonders for creating apps in no time with "amazing" functionalities.

Technologies : java, c#, python, nodejs, etc

Client side rendering (CSR) — Which is sometimes called "Frontend rendering" is a more recent kind of rendering method, this relies on JS executed on the client side (browser) via a JavaScript framework. So, when page is requested, a minimal , little or empty index.html, css and js were downloaded. Here javascript is responsible to send or receive data and update a minimal section of the page without an entire page refresh.. Finally when user click or trigger some event, javascript will send or receive the data commonly to an api rest (json) using an async call (ajax).

This is the most used currently in companies around the world and a required skill in any web developer.

Technologies : react, angular, vue, aurelia, jquery, pure javascript, etc

  • Related