<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_app(self, app, configstore):
 """Initialize the extension for the given application and store. Parse the configuration values stored in the database obtained from the ``WAFFLE_CONFS`` value of the configuration. Arguments: app: Flask application instance configstore (WaffleStore):
 database store. """

        if not hasattr(app, 'extensions'):
            app.extensions = {}

        self.state = _WaffleState(app, configstore)
        app.extensions['waffleconf'] = self.state