Func style:

    templates/
        home/
        control_panel/
        admin/

    views/
        __init__.py
        home.py
        control_panel.py
        admin.py

Zone Style:

    admin/
        __init__.py
        views.py
        static/
        templates/

    home/
        __init__.py
        views.py
        static/
        templates/

    control_panel/
        __init__.py
        views.py
        static/
        templates/

Example:

ap/views/profile.py

from flask import Blueprint, render_template
profile = Blueprint('profile', __name__,
                    template_folder='templates', #Blueprint with self template
                    static_folder='static') #Blueprint with self static

@profile.route('/<user_url>')
def timeline(user_url):
    ...
    return render_template('profile/timeline.html')

@profile.route('/<user_url>/photos')
def photos(user_url):
    ...
    return render_template('profile/photos.html')

@profile.route('/<user_url>/about')
def about(user_url):
    ...
    return render_template('profile/about.html')

ap/__init__.py

from flask import Flask
from .views.profile import profile

app = Flask(__name__)
app.register_blueprint(profile)

Dynamic Url Prefix

instance:

ap/views/profile.py

from flask import Blueprint, render_template
profile = Blueprint('profile', __name__, url_prefix='/<user_url>')

register:

ap/__init__.py

from flask import Flask
from .views.profile import profile

app = Flask(__name__)
app.register_blueprint(profile, url_prefix='/<user_url>')


example:

ap/views/profile.py

from flask import Blueprint, render_template, g
from ..models import User

# The prefix is defined in ap/__init__.py.
profile = Blueprint('profile', __name__)

@profile.url_value_preprocessor
def get_profile_owner(endpoint, values):
    query = User.query.filter_by(url=values.pop('user_url'))
    g.profile_owner = query.first_or_404()

@profile.route('/')
def timeline():
    return render_template('profile/timeline.html')

@profile.route('/photos')
def photos():
    return render_template('profile/photos.html')

@profile.route('/about')
def about():
    return render_template('profile/about.html')

Dynamic SubDomain

ap.com:

ap/__init__.py

from flask import Flask
from .site import site

app = Flask(__name__)
app.register_blueprint(site, subdomain='<site_subdomain>')

subdn.ap.com:

ap/site1/__init__.py

from flask import Blueprint
from ..models import Site

# Site is module, site is Blueprint
site = Blueprint('site', __name__)

@site.url_value_preprocessor
def get_site(endpoint, values):
    query = Site.query.filter_by(subdomain=values.pop('site_subdn'))
    g.site = query.first_or_404()

#View module need import 'site', so def site before import views.
from . import views

#modify var SERVER_NAME
config.py

SERVER_NAME = 'ap.com'