-1

I created a Django project which I use in Apache server.

The project simply edits an .m3u file when you press a button on a page, and generates a new .m3u file. The script works as intended.

Can Django generate a download link automatically for this newly generated .m3u file? I understand from many tutorials that I need to edit the urls.py and view.py files, but I need it to be done automatically.

Or another option would be to make the file downloadable via Apache directly if something like this is possible.

Aryan Beezadhur
  • 4,503
  • 4
  • 21
  • 42
mammalianps
  • 27
  • 1
  • 7
  • It sounds like you're looking for a guide or tutorial, which Stack Overflow is not. Please see [ask], [help/on-topic]. – AMC May 03 '20 at 00:22

1 Answers1

0

is that is it possible Django can generate a download link automatically for this newly generated m3u file

Yes. I assume this is a static file located somewhere on the server. You can make file generator script/function return the location of generated file on server. The download URL can take location of this fileas a query parameter. You can make this file available using Django.

Or another option would be to make the file downloadable via apache diretly if something like this is possible.

Yes, you can. See Can you make a file downloadable through Apache?

narendra-choudhary
  • 4,582
  • 4
  • 38
  • 58