<s> from django . shortcuts import render_to_response , redirect <EOL> from django . core . urlresolvers import reverse <EOL> from django . template import RequestContext <EOL> from django . contrib . sites . models import Site <EOL> def welcome ( request ) : <EOL> """<STR_LIT>""" <EOL> if request . user . is_authenticated ( ) : <EOL> try : <EOL> if request . environ [ '<STR_LIT>' ] : <EOL> referer = request . environ [ '<STR_LIT>' ] <EOL> current_site = Site . objects . get_current ( ) <EOL> if str ( current_site ) in referer : <EOL> request . session [ '<STR_LIT>' ] = reverse ( '<STR_LIT>' ) <EOL> return render_to_response ( '<STR_LIT>' , { } , RequestContext ( request ) ) <EOL> except : pass <EOL> try : <EOL> redirect_url = request . session [ '<STR_LIT>' ] <EOL> if not request . session [ '<STR_LIT>' ] == reverse ( '<STR_LIT>' ) : <EOL> return redirect ( redirect_url ) <EOL> else : <EOL> pass <EOL> except : <EOL> pass <EOL> request . session [ '<STR_LIT>' ] = reverse ( '<STR_LIT>' ) <EOL> return render_to_response ( '<STR_LIT>' , { } , RequestContext ( request ) ) </s>
