diff --git a/CONTRIBUTORS b/CONTRIBUTORS new file mode 100644 index 0000000..730ac71 --- /dev/null +++ b/CONTRIBUTORS @@ -0,0 +1,6 @@ +This Django app is brought to you by Balanced. +Marshall Jones (mjallday) + +And a little help from the community +Timothy John Watts (readevalprint) + diff --git a/django_balanced/management/commands/sync.py b/django_balanced/management/commands/sync.py index 0b4f183..0488d0a 100644 --- a/django_balanced/management/commands/sync.py +++ b/django_balanced/management/commands/sync.py @@ -12,6 +12,5 @@ class Command(BaseCommand): 'local system' def handle(self, *args, **options): - balanced.configure(settings.BALANCED['API_KEY']) BankAccount.sync() Credit.sync() diff --git a/django_balanced/middleware.py b/django_balanced/middleware.py deleted file mode 100644 index eac0932..0000000 --- a/django_balanced/middleware.py +++ /dev/null @@ -1,10 +0,0 @@ -from __future__ import unicode_literals - -import balanced -from django.conf import settings - - -class BalancedMiddleware(object): - - def process_request(*_): - balanced.configure(settings.BALANCED['API_KEY']) diff --git a/django_balanced/settings.py b/django_balanced/settings.py index 290ae47..9985455 100644 --- a/django_balanced/settings.py +++ b/django_balanced/settings.py @@ -3,6 +3,8 @@ from django.conf import settings +import balanced + LOGGER = logging.getLogger(__name__) @@ -37,3 +39,5 @@ if not BALANCED.get('API_KEY'): LOGGER.error('You must set the BALANCED_API_KEY environment variable.') +else: + balanced.configure(BALANCED['API_KEY'])