def get_server(*args, **kwargs):
 from django.conf import settings
 server_name = getattr(settings, 'LETTUCE_TEST_SERVER', 'lettuce.django.server.DefaultServer')
 (module, klass) = server_name.rsplit('.', 1)
 Server = getattr(__import__(module, fromlist=[klass]), klass)
 global server, django_url
 server = Server(*args, **kwargs)
 django_url = server.url
 return server

def get_server ( * args , ** kwargs ) : from django . conf import settings server_name = getattr ( settings , 'LETTUCE_TEST_SERVER' , 'lettuce.django.server.DefaultServer' ) ( module , klass ) = server_name . rsplit ( '.' , 1 ) Server = getattr ( __import__ ( module , fromlist = [ klass ] ) , klass ) global server , django_url server = Server ( * args , ** kwargs ) django_url = server . url return server
look up the server we are using and set it as the global .