Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #27 from michael-borisov/patch-1
Browse files Browse the repository at this point in the history
Using not deprecated method to import through strings
  • Loading branch information
EnTeQuAk committed Mar 18, 2015
2 parents 16b2853 + 46019ea commit 27e6ec4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions omnibus/management/commands/omnibusd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import logging

from django.core.management.base import BaseCommand
from django.utils.module_loading import import_by_path

try:
from django.utils.module_loading import import_string
except ImportError:
from django.utils.module_loading import import_by_path as import_string

from tornado import ioloop

from ...pubsub import PubSub
Expand All @@ -27,9 +32,9 @@ def handle(self, *args, **kwargs):
pubsub.init_forwarder()

# Get factories for connection and tornado webapp.
authenticator_factory = import_by_path(AUTHENTICATOR_FACTORY)
connection_factory = import_by_path(CONNECTION_FACTORY)
webapp_factory = import_by_path(WEBAPP_FACTORY)
authenticator_factory = import_string(AUTHENTICATOR_FACTORY)
connection_factory = import_string(CONNECTION_FACTORY)
webapp_factory = import_string(WEBAPP_FACTORY)

# Create app and listen on SEVER_PORT
app = webapp_factory(connection_factory(authenticator_factory(), pubsub))
Expand Down

0 comments on commit 27e6ec4

Please sign in to comment.