Skip to content

Commit

Permalink
add subdomain support when using local serving
Browse files Browse the repository at this point in the history
  • Loading branch information
lobeck committed Feb 1, 2015
1 parent b78eab7 commit 7ee171a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Option Default
====================================== ======================================================== ===
``BOOTSTRAP_USE_MINIFIED`` ``True`` Whether or not to use the minified versions of the css/js files.
``BOOTSTRAP_SERVE_LOCAL`` ``False`` If ``True``, Bootstrap resources will be served from the local app instance every time. See :doc:`cdn` for details.
``BOOTSTRAP_LOCAL_SUBDOMAIN`` ``None`` If ``BOOTSTRAP_SERVE_LOCAL`` is ``True`` and this is not ``None``, all assets are served on the specified sub-domain (f.e. static) - flask will automatically append ``SERVER_NAME``
``BOOTSTRAP_CDN_FORCE _SSL`` ``True`` If a CDN resource url starts with ``//``, prepend ``'https:'`` to it.
``BOOTSTRAP_QUERYSTRING_REVVING`` ``True`` If ``True``, will append a querystring with the current version to all static resources served locally. This ensures that upon upgrading Flask-Bootstrap, these resources are refreshed.
====================================== ======================================================== ===
5 changes: 4 additions & 1 deletion flask_bootstrap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@ def init_app(self, app):
app.config.setdefault('BOOTSTRAP_QUERYSTRING_REVVING', True)
app.config.setdefault('BOOTSTRAP_SERVE_LOCAL', False)

app.config.setdefault('BOOTSTRAP_LOCAL_SUBDOMAIN', None)

blueprint = Blueprint(
'bootstrap',
__name__,
template_folder='templates',
static_folder='static',
static_url_path=app.static_url_path + '/bootstrap')
static_url_path=app.static_url_path + '/bootstrap',
subdomain=app.config['BOOTSTRAP_LOCAL_SUBDOMAIN'])

app.register_blueprint(blueprint)

Expand Down

0 comments on commit 7ee171a

Please sign in to comment.