Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,194,598 members, 7,955,198 topics. Date: Saturday, 21 September 2024 at 07:23 PM

Python Flask Help - How Can I Solve This. - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Python Flask Help - How Can I Solve This. (701 Views)

Can You Solve This Google Coding Interview Problem? (pics) / How Do I Solve This Python (anaconda) Problem / How To Access Pulseway Restful API Using Python Flask (2) (3) (4)

(1) (Reply) (Go Down)

Python Flask Help - How Can I Solve This. by fnep2smooth(m): 4:39pm On Jan 16, 2021
I have this YouTube channel am managing and I am creating a web app with flask to automatic download the audio of the video in my channel.

In my code I use moviepy to extract the video and also convert it to audio.

Now my challenge is after the download and moving it to the specific folder, I return a download.html template to show a download link button but I can be able to create get the link.

I also try to out put the download to my browser as an attachment through send_file but it's not working. The attachment will download but only on the terminal I want to push it to the browser , please any help

UPDATE
The first image was the reason i created this thread, before then i was having issue with existing file after coveting and trying to move it to the specific folder i want. this require me to delete the file existing attachment before running the code, so i used shutil.move to overwrite the existing file which you can see in the second image....

but still can download the attachment

Code below.

Re: Python Flask Help - How Can I Solve This. by Karleb(m): 7:15pm On Jan 18, 2021
Have you been able to solve this?


From what I'm seeing, you are only rendering the view you are not sending any data to it.

I don't write flask but I think the return should be like.

return render_template('promote. html').with('attachment.file')
Re: Python Flask Help - How Can I Solve This. by kensmoney(m): 11:09am On Jan 19, 2021
Put the attachment in ur return statement, then in ur front end, use "jinja2 template engine" to render the attachment
Re: Python Flask Help - How Can I Solve This. by fnep2smooth(m): 5:19pm On Jan 24, 2021
Karleb:
Have you been able to solve this?


From what I'm seeing, you are only rendering the view you are not sending any data to it.

I don't write flask but I think the return should be like.

return render_template('promote. html').with('attachment.file')
An just seeing your message now... Let me update the new error
Re: Python Flask Help - How Can I Solve This. by fnep2smooth(m): 7:39pm On Jan 24, 2021
UPDATE
The first image was the reason i created this thread, before then i was having issue with existing file after coveting and trying to move it to the specific folder i want. this require me to delete the file existing attachment before running the code, so i used shutil.move to overwrite the existing file which you can see in the second image....

(1) (Reply)

Brokenness And Programming / ? / How Can I Make This My Laptop More Effective For Programming.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.