<s> from importlib import import_module <EOL> from django . conf import settings <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from django_extensions . management . utils import signalcommand <EOL> try : <EOL> from django . contrib . auth import get_user_model <EOL> except ImportError : <EOL> from django_extensions . future_1_5 import get_user_model <EOL> try : <EOL> from django . contrib . sessions . backends . base import VALID_KEY_CHARS <EOL> except ImportError : <EOL> VALID_KEY_CHARS = "<STR_LIT>" <EOL> class Command ( BaseCommand ) : <EOL> help = ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> args = "<STR_LIT>" <EOL> label = '<STR_LIT>' <EOL> can_import_settings = True <EOL> @ signalcommand <EOL> def handle ( self , * args , ** options ) : <EOL> if len ( args ) > <NUM_LIT:1> : <EOL> raise CommandError ( "<STR_LIT>" ) <EOL> if len ( args ) < <NUM_LIT:1> : <EOL> raise CommandError ( "<STR_LIT>" ) <EOL> key = args [ <NUM_LIT:0> ] . lower ( ) <EOL> if not set ( key ) . issubset ( set ( VALID_KEY_CHARS ) ) : <EOL> raise CommandError ( "<STR_LIT>" ) <EOL> engine = import_module ( settings . SESSION_ENGINE ) <EOL> if not engine . SessionStore ( ) . exists ( key ) : <EOL> print ( "<STR_LIT>" ) <EOL> return <EOL> session = engine . SessionStore ( key ) <EOL> data = session . load ( ) <EOL> print ( '<STR_LIT>' % session . get_expiry_date ( ) ) <EOL> print ( '<STR_LIT>' % data ) <EOL> uid = data . get ( '<STR_LIT>' , None ) <EOL> if uid is None : <EOL> print ( '<STR_LIT>' ) <EOL> return <EOL> print ( "<STR_LIT>" % uid ) <EOL> User = get_user_model ( ) <EOL> try : <EOL> user = User . objects . get ( pk = uid ) <EOL> except User . DoesNotExist : <EOL> print ( "<STR_LIT>" ) <EOL> return <EOL> username_field = '<STR_LIT:username>' <EOL> if hasattr ( User , '<STR_LIT>' ) and User . USERNAME_FIELD is not None : <EOL> username_field = User . USERNAME_FIELD <EOL> for key in [ username_field , '<STR_LIT:email>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> print ( "<STR_LIT>" % ( key , getattr ( user , key ) ) ) </s>
