One of the beautiful things about Flask is the freedom to do whatever the hell you want. Unfortunately, for me as a novice, this can be a huge disadvantage at the same time. Not knowing all of the best practices can cause some unnecessary headache. Lucky for me there are a lot of blog entries out there to help get this off the ground.
Blueprints is a flask feature that allows you to organize your app in a modular way. Each “section” will act almost as if it is it’s own application. I took a screenshot of my current directory structure to show you what it looks like. So the project itself would be considered a repository,
and will end up on github at some point as I make more solid plans.
Right now I just wanted to get something running even if it is technically just a simple and basic “Hello World.”
Currently the run.py file contains:
When ran, it then goes to the flaskcasts directory since it is a module and runs the code in __init__.py:
This will go to the home blueprint and execute that code:
The only other file is config.py and it basically holds the DEBUG=True boolean only.
Structurally, for a very basic application that is only going to feed videos from a YouTube or similar service, this should suffice.