<s> import logging <EOL> from django . conf import settings <EOL> from django . core . handlers . wsgi import WSGIHandler <EOL> from django . core . cache import cache <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from gevent import monkey <EOL> from socketio import SocketIOServer <EOL> class Command ( BaseCommand ) : <EOL> args = '<STR_LIT>' <EOL> help = '<STR_LIT>' <EOL> def handle ( self , * args , ** options ) : <EOL> """<STR_LIT>""" <EOL> logging . basicConfig ( ) <EOL> logging . getLogger ( ) . setLevel ( logging . INFO ) <EOL> try : <EOL> port = int ( args [ <NUM_LIT:0> ] ) <EOL> except : <EOL> port = <NUM_LIT> <EOL> monkey . patch_all ( ) <EOL> application = WSGIHandler ( ) <EOL> print '<STR_LIT>' % port <EOL> SocketIOServer ( ( '<STR_LIT>' , port ) , application , <EOL> resource = '<STR_LIT>' ) . serve_forever ( ) </s>
