In the process of Django web development, when writing HTML, a list variable with the same name is passed from the backend, but the content format is different and needs to be judged separately. I have consulted many articles and tried several methods, but the format seems to be wrong (I have not systematically studied the front end, and basically just copied it) The format is roughly as follows <div class="if/else"> {% if formname == 'Callrecords' %} Callrecords {% elif formname == 'Riderecords' %} Riderecords {% elif formname == 'Clubinfo' %} Clubinfo {% elif formname == 'Clubmemb' %} Clubmemb {% elif formname == 'Personinfo' %} Personinfo {% endif %} </div> This syntax is provided by Django and is used in native HTML code writing but is useless. The code box above uses the HTML format, but you can also see that the content between the <div> tags cannot be marked by the HTML language, indicating that it is not a built-in HTML syntax. Summarize The above is the usage of if judgment in HTML introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time! |
<<: How to check if data exists before inserting in mysql
>>: Detailed explanation of the principle of Vue monitoring data
1. In Windows system, many software installations...
Preface Nowadays, in projects, the Axios library ...
<br />Some web pages may not look large but ...
In this article, we will look at how to develop a...
How to use iframe: Copy code The code is as follo...
Table of contents 1. Background 2. Table creation...
Table of contents 1. The role of index 2. Creatin...
In Linux system, newly install docker and enter t...
Recently I want to use goaccess to analyze nginx ...
Table of contents 1. Component Registration 2. Us...
Table of contents 1. Introduction to Compose 2. C...
In the project, you will encounter custom public ...
This article example shares the specific code of ...
MySql always pops up a MySQLInstallerConsole.exe ...
Our network management center serves as the manag...