How does Django pass the numbers selected by html to the backend?

Hello everyone, I used django2.0 to make an operation and maintenance platform, and used the form form in the front page a.html. The effect is shown in figure

clipboard.png

now you need to select the corresponding data sequence number in a.html, click "execute" on the page, and a dialog box will pop up-"are you sure you want to execute?" After clicking OK, there will be a python script in the background (not in the django system, such as / tmp/aaa.py) to perform the task with the serial number. An execution result is then returned to b.html.

I can now get the corresponding sequence number in views.py, but how can you pass this "sequence number" to the aaa.py script in the background? Do I have to use ajax?


Django has a RadioSelect form option
if you are using Form output, you can do the confrim action when you onsubmit. Normally, you need JS to complete this logic.

HTML:

<script>
function clicked(e)
{
    if(!confirm('Are you sure?')) {
        
    }
}
</script>
Menu