user = { 'username': 'Booboo Wei', 'bio': 'A girl who loves movies and music.', } movies = [ {'name': 'My Neighbor Totoro', 'year': '1988'}, {'name': 'Three Colours trilogy', 'year': '1993'}, {'name': 'Forrest Gump', 'year': '1994'}, {'name': 'Perfect Blue', 'year': '1997'}, {'name': 'The Matrix', 'year': '1999'}, {'name': 'Memento', 'year': '2000'}, {'name': 'The Bucket list', 'year': '2007'}, {'name': 'Black Swan', 'year': '2010'}, {'name': 'Gone Girl', 'year': '2014'}, {'name': 'CoCo', 'year': '2017'}, ]
class Happy(BaseView): @expose('/') def index(self): return self.render('happy.html',user=user, movies=movies)
admin.add_view(Happy(name=u'工作之愉'))
|