Skip to content

Instantly share code, notes, and snippets.

@amercader
Created October 4, 2017 11:53
Show Gist options
  • Save amercader/bbc8223e1f098e05005691a31b6fa7a0 to your computer and use it in GitHub Desktop.
Save amercader/bbc8223e1f098e05005691a31b6fa7a0 to your computer and use it in GitHub Desktop.
diff --git a/ckan/config/middleware/flask_app.py b/ckan/config/middleware/flask_app.py
index 5137b8a..c5b9c80 100644
--- a/ckan/config/middleware/flask_app.py
+++ b/ckan/config/middleware/flask_app.py
@@ -355,7 +355,9 @@ def _register_core_blueprints(app):
def is_blueprint(mm):
return isinstance(mm, Blueprint)
- for loader, name, _ in pkgutil.iter_modules(['ckan/views'], 'ckan.views.'):
+ path = os.path.join(os.path.dirname(__file__), '..', '..', 'views')
+
+ for loader, name, _ in pkgutil.iter_modules([path], 'ckan.views.'):
module = loader.find_module(name).load_module(name)
for blueprint in inspect.getmembers(module, is_blueprint):
app.register_blueprint(blueprint[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment