<s> from flask import Flask , request , url_for <EOL> from flask . ext . micropub import MicropubClient <EOL> app = Flask ( __name__ ) <EOL> app . config [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> micropub = MicropubClient ( app ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def index ( ) : <EOL> return """<STR_LIT>""" <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def authenticate ( ) : <EOL> return micropub . authenticate ( <EOL> request . args . get ( '<STR_LIT>' ) , next_url = url_for ( '<STR_LIT:index>' ) ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def authorize ( ) : <EOL> return micropub . authorize ( <EOL> request . args . get ( '<STR_LIT>' ) , next_url = url_for ( '<STR_LIT:index>' ) , <EOL> scope = request . args . get ( '<STR_LIT>' ) ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> @ micropub . authenticated_handler <EOL> def indieauth_callback ( resp ) : <EOL> return """<STR_LIT>""" . format ( resp . me , resp . next_url , resp . error ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> @ micropub . authorized_handler <EOL> def micropub_callback ( resp ) : <EOL> return """<STR_LIT>""" . format ( resp . me , resp . micropub_endpoint , resp . access_token , <EOL> resp . next_url , resp . error ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> app . run ( debug = True ) </s>
