Beispiel #1
0
    def setUp(self):
        import sys
        import os

        os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

        from django.core.management import execute_manager
        try:
            import settings  # Assumed to be in the same directory.
        except ImportError:
            sys.stderr.write(
                "Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n"
                % __file__)
            sys.exit(1)

        from settings import logger
        self.lrcLookupService = LrcLookupService(
            'wgu.solutionstream.com:8080/lrcs/ws/provision/lookup/resourceId')
Beispiel #2
0
def lookupLrc(request, **kwargs):
    resourceId = kwargs['resourceId']
    lrcLookupService = LrcLookupService(settings.LRC_LOOKUP_SERVICE_URL)
    result = lrcLookupService.lookup(resourceId)
    return HttpResponse(result)