Skip to content

Refactoring view methods with blueprints #12

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

Closed
josh-thurston opened this issue Mar 17, 2020 · 2 comments
Closed

Refactoring view methods with blueprints #12

josh-thurston opened this issue Mar 17, 2020 · 2 comments

Comments

@josh-thurston
Copy link

Cannot figure out why everything stops working at the moment when I switch app.py over to use blueprints. I am copying what you do in the video, but when i run app.py, I get a 404 return.

As soon as i switch back to original app.py setup, this work again.

@josh-thurston
Copy link
Author

Ignore comment. I looked at the code here in the repo. I noticed that you added more to app.py that was not covered in the video. I added the new lines of code and everything started working.

@mikeckennedy
Copy link
Member

Hi @josh-thurston Glad you found the fix. Here is what's happening.

If you just run the app.py file, everything works as expected. If PyCharm somehow detects this as a flask project, it uses $ flask run which does NOT run the main() method. That's why you see the minor tweak in the code to still configure the system.

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

No branches or pull requests

2 participants