<s> from django . http import Http404 <EOL> from django . views . generic import View <EOL> class DomainAPI ( View ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def allowed_domain ( self , domain ) : <EOL> return False <EOL> @ classmethod <EOL> def api_version ( cls ) : <EOL> raise NotImplementedError ( "<STR_LIT>" ) <EOL> @ classmethod <EOL> def api_name ( cls ) : <EOL> raise NotImplementedError ( "<STR_LIT>" ) <EOL> http_method_names = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , ] <EOL> def get ( self , * args , ** kwargs ) : <EOL> raise NotImplementedError ( "<STR_LIT>" ) <EOL> def post ( self , * args , ** kwargs ) : <EOL> raise NotImplementedError ( "<STR_LIT>" ) <EOL> def head ( self , * args , ** kwargs ) : <EOL> raise NotImplementedError ( "<STR_LIT>" ) <EOL> def dispatch ( self , * args , ** kwargs ) : <EOL> req = args [ <NUM_LIT:0> ] <EOL> if not self . allowed_domain ( req . domain ) : <EOL> raise Http404 <EOL> ret = super ( DomainAPI , self ) . dispatch ( * args , ** kwargs ) <EOL> return ret </s>
