def prepare_config(config):
 p = config.copy()
 p.update({k: json.dumps(v, ensure_ascii=False) for (k, v) in p.items() if (k not in (u'POSTS', u'PAGES', u'COMPILERS', u'TRANSLATIONS', u'NAVIGATION_LINKS', u'_SUPPORTED_LANGUAGES', u'_SUPPORTED_COMMENT_SYSTEMS', u'INDEX_READ_MORE_LINK', u'FEED_READ_MORE_LINK'))})
 p[u'INDEX_READ_MORE_LINK'] = ((u"'" + p[u'INDEX_READ_MORE_LINK'].replace(u"'", u"\\'")) + u"'")
 p[u'FEED_READ_MORE_LINK'] = ((u"'" + p[u'FEED_READ_MORE_LINK'].replace(u"'", u"\\'")) + u"'")
 p.update({k: str(v) for (k, v) in config.items() if (isinstance(v, bool) or (v is None))})
 return p

def prepare_config ( config ) : p = config . copy ( ) p . update ( { k : json . dumps ( v , ensure_ascii = False ) for ( k , v ) in p . items ( ) if ( k not in ( u'POSTS' , u'PAGES' , u'COMPILERS' , u'TRANSLATIONS' , u'NAVIGATION_LINKS' , u'_SUPPORTED_LANGUAGES' , u'_SUPPORTED_COMMENT_SYSTEMS' , u'INDEX_READ_MORE_LINK' , u'FEED_READ_MORE_LINK' ) ) } ) p [ u'INDEX_READ_MORE_LINK' ] = ( ( u"'" + p [ u'INDEX_READ_MORE_LINK' ] . replace ( u"'" , u"\\'" ) ) + u"'" ) p [ u'FEED_READ_MORE_LINK' ] = ( ( u"'" + p [ u'FEED_READ_MORE_LINK' ] . replace ( u"'" , u"\\'" ) ) + u"'" ) p . update ( { k : str ( v ) for ( k , v ) in config . items ( ) if ( isinstance ( v , bool ) or ( v is None ) ) } ) return p
parse sample config with json .