Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Robpol86/Flask-Large-Application-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-Large-Application-Example

PyPI Portal is a small demo app used as an example of a potentially large Flask application with several views and Celery tasks. This is how I structure my large Flask applications. In this README I'll explain my design choices with several aspects of the project.

For information on how to deploy this application to different production environments, visit the project's wiki.

For a demo of this application running in the cloud, visit http://ec2-54-213-40-230.us-west-2.compute.amazonaws.com/.

[Build Status] (https://travis-ci.org/Robpol86/Flask-Large-Application-Example) [Coverage Status] (https://coveralls.io/r/Robpol86/Flask-Large-Application-Example)

Directory Structure

├─ pypi_portal        # All application code in this directory.
│  ├─ core
│  ├─ models
│  │  ├─ fruit.py
│  │  └─ vegetable.py
│  │
│  ├─ static
│  │  ├─ favicon.ico
│  │  └─ some_lib
│  │     ├─ css
│  │     │  └─ some_lib.css
│  │     └─ js
│  │        └─ some_lib.js
│  │
│  ├─ tasks
│  ├─ templates       # Base templates used/included throughout the app.
│  │  ├─ 404.html
│  │  └─ base.html
│  │
│  ├─ views
│  │  ├─ view1
│  │  │  ├─ templates               # Templates only used by view1.
│  │  │  │  └─ view1_section1.html  # Naming convention: package_module.html
│  │  │  │
│  │  │  ├─ section1.py             # Each view module has its own blueprint.
│  │  │  └─ section2.py
│  │  │
│  │  ├─ view2
│  │  └─ view3
│  │
│  ├─ application.py  # Flask create_app() factory.
│  ├─ blueprints.py   # Define Flask blueprints and their URLs.
│  ├─ config.py       # All configs for Flask, Celery, Prod, Dev, etc.
│  ├─ extensions.py   # Instantiate SQLAlchemy, Celery, etc. Importable.
│  └─ middleware.py   # Error handlers, template filters, other misc code.
│
├─ tests
│
└─ manage.py          # Main entry-point into the Flask/Celery application. 

About

This is how I structure my large Flask applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published