diff --git a/bakery/management/commands/build.py b/bakery/management/commands/build.py index 3ad2c72..8d1de31 100644 --- a/bakery/management/commands/build.py +++ b/bakery/management/commands/build.py @@ -188,6 +188,12 @@ def build_media(self): os.path.join(self.build_dir, settings.MEDIA_URL.lstrip('/')) ) + def get_view_instance(self, view): + """ + Given a view class, get an instance of it. + """ + return view() + def build_views(self): """ Bake out specified buildable views. @@ -198,7 +204,7 @@ def build_views(self): if self.verbosity > 1: self.stdout.write("Building %s" % view_str) view = get_callable(view_str) - view().build_method() + self.get_view_instance(view).build_method() def copytree_and_gzip(self, source_dir, target_dir): """