I know that you can have PHP -code inside HTML -file. I would like to know how you can do the same with Python.
How can you run Python inside a HTML document?
|
|
|
Look at django templating engine for example. django |
|||||
|
|
|||
|
|
You will need something like mod_python for apache, or play with cgi. It really depends on your web server |
|||||
|
|
Use Mako or Jinja2. Both are very fast, and best at doing their job. You should not create SQL queries in your template, but in your controller logic. Later, pass variables/functions to a template and output them. |
|||
|
|