Python scripts in HTML

后端 未结 5 1160
醉梦人生
醉梦人生 2020-12-16 21:02

Is it possible to write Python scripts in HTML code similarly as you write PHP between tags?

I\'d like to achieve that m

5条回答
  •  醉话见心
    2020-12-16 21:49

    Python indentation requirements don't go well with mixing HTML and Python code. Therefore, the most prominent method (which is a framework called Django), uses a template engine so that the Python is never in direct contact with the HTML code.

    It will be similar to PHP and not javascript, as it will run on the server-side.

    There is also mod_python for Apache, but I would strongly recommend using Django, which also runs on an Apache server.

提交回复
热议问题