php - Are there Django short tags for web development? If there are, how to enable it?
602
Example of native PHP code:
<h1><?php echo "Hello world!"; ?></h1>
Example of PHP short tags:
<h1><? echo "Hello world!"; ?></h1>
Are there Python code that looks like this:
<h1><% print "Hello world!"; %></h1>
If there are, how to enable that?
Answer
Solution:
Generally Python works a little bit different to PHP. You need a template engine to do that. See: https://wiki.python.org/moin/Templating
Answer
Solution:
A big yes. The tags in Django look like this:
Django is a very good framework, unlike anything I have ever seen (part of it is because Python is a great language!)
You can't execute arbitrary code here, but take it as an advantage: you will respect MVC better