How to run external python script after a file is loaded in a Django page

Hello ,

First, i’m new on Django so please excuse me if my question is a bit basic.

I’m trying to develop a web application for the company where i’m doing my internship and for it i already developped a python script to process an xls file.
What i want to do now is to create a page on django with a load button so that the user can load his file. Then my script launches and then displays the result as a table on that same page.

So i know how to generate an html page with a load button but i don’t know how to create this link with my script then.

Does i have to put my script in a specific directory in my project ? Can someone enlighten me on the process?

Thank you very much

If this is your first project with Django, then I strongly recommend you start with the Official Django Tutorial and/or the Django Girls Tutorial.
(The way your question is worded gives me the impression that you’re not familiar with how Django processes requests and produces responses. Either or both of those tutorials will teach you the fundamentals you’ll need to start to understand the framework.)

Thank you for the links, I’ll definitely read it in greater detail.

Now I think that I pretty well understood the urls, views and template system in Django. How to do dynamic links in the views too.
So I’m pretty sure that if you could explain me the big steps of such process I’ll deal it.But in the case of what I’m looking to do is clearly not a common use of Django, it will also save me lots of time.

Thank you again for your answer.

Sure it is.

You’re presenting a form.

A person submits the form.

You’re processing the data submitted in the form.

You’re returning results.

This is precisely a standard use-case for Django.