How to run python script from an html page ?

Hello everyone,

I’m new to Django so my question may seem simple but I can’t solve it alone.

I have a Python script that asks an .xls file, processes it and returns an .xls file.
I would like to be able to launch it from a simple button on a page of my Django project and when finished, display some sort of personalized message.

My problem is how to link an run this script with an html button, and how to edit my html page from my python script?

I know how to do it in JavaScript but I’d rather use python.
It seems to be a classic use of Django but I haven’t found any concrete examples.

Thank you in advance for your help

Yes Django can do that. You would do that work in what Django calls a “view”.

To learn about Django, I suggest you start with the First Steps as shown in the docs.