Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flask displaying old / cached version of the app #114

Open
s2t2 opened this issue Nov 22, 2022 · 1 comment
Open

Flask displaying old / cached version of the app #114

s2t2 opened this issue Nov 22, 2022 · 1 comment

Comments

@s2t2
Copy link
Member

s2t2 commented Nov 22, 2022

A handful of students are encountering an issue whereby they are developing a flask app locally, and when they make some new changes to the code and restart the local web server, it doesn't show the updated changes, but rather what appears to be an older state of the web app code.

I have confirmed they are saving the files properly and restarting the web app, and their code looks identical to mine and other students whose apps are working locally. The weird thing is the same code and usage command works for me and many other students, but not for a few of them.

See pallets/flask#4874

Hopefully we can hear about a fix to this issue.

@s2t2
Copy link
Member Author

s2t2 commented Dec 9, 2022

Before troubleshooting, make sure there isn't a local flask server running, or stop it with control+c.

Troubleshooting

We can open up the Powershell program on Windows, which is an alternative version of Git Bash, and run the following commands...

First we see what processes are currently running on port 5000:

netstat -ano | findstr :5000

If there are issues, you may see multiple entries get returned, meaning there are some old processes we need to kill.

image

We can run the following command from powershell to kill a given process, specifying the number provided by the netstat command results:

# where 18956 is an example process number found from the previous command
stop-process 18956

Repeat this command for all process numbers.

After all the old processes are cleared, the next time you run flask run it should reflect the current state of your app! 🎉

Unfortunately in the future you may need to continue to repeat this process. But at least it helps us get unblocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant