Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
258 views
in Technique[技术] by (71.8m points)

python - How to organize a relatively large Flask application?

I'm building my first Flask app and I can't figure out a good, clean Pythonic way of organizing my application. I don't want to have everything in a single .py file as in their example. I would like to have each part of my app in a separate module. What would be a good way to organize things?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...