Flask - filezilla changes to static html templates not working?
I must be missing something very basic.
I've set up a Flask app with nginx and gunicorn on ubuntu 20.10.
Everything works as intended and site is great.
However, when I try to make a basic change, i.e. Change the title of h1 tag, to a template - home.html - file, and drag/drop it into FileZilla SFTP, the changes do not take effect in production.
I've tried hard refresh, incognito, sudo gunicorn restart, but still no luck seeing the basic changes.
Any ideas as to what I'm missing?
Thanks in advance!
I want to preface this to say I don't have a lot of experience with Flask, but I wanted to help out as much as possible.
I did some digging around online to see what I could find that might be helpful to you - and I came across a few links I wanted to share. Keep in mind that since I don't know all the specifics of your configurations, I can only speculate on what might be helpful to you.
This Stack Overflow article seems to be about something similar to what you're experiencing. There are some sample configurations shown in it that you might be able to get something from - and this user is also using Gunicorn, which is what got my attention:
This other article I found on GitHub talks about Flask not reloading when code is changed. It gives some steps you can take to check - you'll need to scroll to the bottom for what looks like the most helpful response:
I hope this gets you pointed in the right direction. I see you've also added some great tags to this post to give it more visibility in the Community, so I invite other users to give their ideas here, too.
Hi @rgerke - Thank you for taking the time to find these links. It appears they were useful and I managed to now resolve the issue!
For future reference if anyone gets stuck, Flask runs on
gunicorn as mentioned in your links, and has a "monitor" called
supervisor which when set up will automatically restart the web app should something go wrong.
So after a lot of digging, I found that the command
sudo systemctl reload supervisor will reload the python app, and thus, restarting makes all the changes show up!
Many, many thanks again.