# How to run python script from an html page ?

**URL:** <https://forum.djangoproject.com/t/how-to-run-python-script-from-an-html-page/9721>\
**Category:** Using Django\
**Created:** [September 16, 2021, 10:01am UTC](https://forum.djangoproject.com/t/how-to-run-python-script-from-an-html-page/9721 "2021-09-16T10:01:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptrs32](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@ptrs32](https://forum.djangoproject.com/u/ptrs32)\
**Post date:** [September 16, 2021, 10:01am UTC](https://forum.djangoproject.com/t/how-to-run-python-script-from-an-html-page/9721/1 "2021-09-16T10:01:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 16, 2021, 11:07am UTC](https://forum.djangoproject.com/t/how-to-run-python-script-from-an-html-page/9721/2 "2021-09-16T11:07:05Z")

</div>

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](https://docs.djangoproject.com/en/3.2/#first-steps) as shown in the docs.
