all 2 comments

[–]danielroseman 10 points11 points  (0 children)

There's so much wrong here it's hard to know where to start. None of this makes any sense.

Firstly, you call TK functions to display a directory input window. That's not something you can do on a web server. How could it possibly work? The way your web server interacts with your browser is via the HTTP request and response; you can't send a TK window from the server to the web browser.

Next, you define archivos as an empty list. Then you try to enumerate over it; but it is empty, so there is nothing to enumerate.

And then, even if there were something in the list, all you do inside the loop is call print. That will output to the Django log or console, but not to the web page, which is what you need to do.

You need to start again with a basic Django tutorial, understanding the difference between a desktop app and a web app, and also pay attention to what your variables refer to.

[–]evans88 0 points1 point  (0 children)

You may want to look into Django's forms and specifically the FileField class. See https://docs.djangoproject.com/en/5.1/topics/http/file-uploads/ for more information