How to organize a relatively large Flask application?
Solution 1:
I have created a Flask boilerplate project called "Fbone", please feel free to check it out and fork :)
Fbone (Flask bone) is a Flask (Python microframework) template/bootstrap/boilerplate application.
Overview
- Well designed for big project using blueprint.
- Integrate with hottest frontend framework: jQuery / html5boilerplate / bootstrap.
- Backed by the famous SQLalchemy.
- Implement tricky "remember me" by flask-login.
- Handle web forms by flask-wtform.
- Unit testing with flask-testing and nose.
- Easily deploy via fabric and mod_wsgi (example included).
- i18n by flask-babel
btw, I just found this wiki on building a large project with Flask useful, pls check it!
Solution 2:
Flask 0.7 implements Blueprints. They are great for using the route
decorator without importing the main application object.