Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added blueprint to baseframe-assets #246

Merged
merged 6 commits into from Nov 28, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions baseframe/__init__.py
Expand Up @@ -248,6 +248,14 @@ def init_app(
app.assets.register('css_all', css_all)
app.register_blueprint(self, static_subdomain=subdomain)

for module_name in app.config.get('PRIVATE_ASSETS', []):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use config as it's a statutory requirement for the client app and not a configuration issue. Take it as a parameter named asset_modules instead.

try:
module = __import__(module_name)
module.blueprint.init_app_assets(app, assets)
app.register_blueprint(module.blueprint)
iambibhas marked this conversation as resolved.
Show resolved Hide resolved
except ImportError:
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log an error here (app logger or Blueprint logger).


# Optional config for a client app to use a manifest file
# to load fingerprinted assets
# If used with webpack, the client app is expected to specify its own webpack.config.js
Expand Down