Home  >  Q&A  >  body text

python - How to call up the modal box through buttons on the django list page

As shown above, I want to call up a modal box through a button on the Django list page to confirm and cancel the operation. I don’t know how to operate the template.
The template of the list page is provided in the Django source code. If the ordinary template file can write the modal box code into the current template file, but the source code cannot be modified, if the template change_list.html of the list page can be made to include the modal The box code can be adjusted

phpcn_u1582phpcn_u15822733 days ago657

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-19 10:08:50

    Django will first look for the html file in the templates directory of your project
    Once you know this, you can copy the corresponding html under your django admin to your templates directory
    For example, your current link is /admin/a /b
    You put the corresponding change_list.html in /templates/admin/a/b/change_list.html

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-19 10:08:50

    I personally prefer not to rely too much on the admin backend, especially when there are a lot of customization requirements. I usually write a web app myself

    reply
    0
  • Cancelreply