connected widget_generator function in views to widget_gen.html template