title: Django REST Framework share class instance between files
body: <p>I have some code in my apps.py's <code>ready()</code> method that loads some Oauth providers using the authlib module. Basically I am doing this (apps.py):</p>
  <pre><code>from django.apps import AppConfig
  from authlib.integrations.django_client import OAuth
  from django.core.cache import caches
  
  class ApiConfig(AppConfig):
      name = 'api'
  
      def ready(self):
          import api.receivers
          defaultcache = caches['default']
          from .modules.oauth import fetch_token
          from .models import OauthProvider, OAuth2Token
  
          oauth = OAuth(fetch_token=fetch_token)
          print('settings oauthproviders')
          allproviders = OauthProvider.objects.all()
          for provider in allproviders:
              oauth.register(
                  name=provider.name,
                  client_id=provider.client_id,
                  client_secret=provider.client_secret_decrypted,
                  access_token_url=provider.access_token_url,
                  access_token_params=provider.access_token_params,
                  authorize_url=provider.authorize_url,
                  authorize_params=provider.authorize_params,
                  api_base_url=provider.api_base_url,
                  client_kwargs=eval(provider.client_kwargs),
              )
  
          print(OAuth2Token.objects.get(name='enelogic'))
          defaultcache.set('oauth', oauth)
          #defaultcache.get('oauth') # &lt;--- this line gives error
  </code></pre>
  <p>Error:</p>
  <pre><code>Fatal Python error: Cannot recover from stack overflow.
  Python runtime state: initialized
  
  Thread 0x00001d4c (most recent call first):
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 306 in wait
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 558 in wait
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd.py&quot;, line 230 in _on_run
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py&quot;, line 46 in run
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 932 in _bootstrap_inner
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 890 in _bootstrap
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydev_bundle\pydev_monkey.py&quot;, line 823 in __call__
  
  Thread 0x00002b80 (most recent call first):
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 306 in wait
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 558 in wait
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd.py&quot;, line 184 in _on_run
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py&quot;, line 46 in run
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 932 in _bootstrap_inner
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 890 in _bootstrap
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydev_bundle\pydev_monkey.py&quot;, line 823 in __call__
  
  Thread 0x0000609c (most recent call first):
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 306 in wait
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 558 in wait
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_timeout.py&quot;, line 43 in _on_run
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py&quot;, line 46 in run
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 932 in _bootstrap_inner
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 890 in _bootstrap
  
  Thread 0x00000ad4 (most recent call first):
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py&quot;, line 209 in _read_line
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py&quot;, line 227 in _on_run
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py&quot;, line 46 in run
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 932 in _bootstrap_inner
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 890 in _bootstrap
  
  Thread 0x00005cf8 (most recent call first):
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_net_command.py&quot;, line 111 in send
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py&quot;, line 370 in _on_run
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_daemon_thread.py&quot;, line 46 in run
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 932 in _bootstrap_inner
    File &quot;c:\program files (x86)\python38-32\lib\threading.py&quot;, line 890 in _bootstrap
  
  Current thread 0x00005924 (most recent call first):
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 476 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 493 in __init__
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 103 in print_exception
    File &quot;c:\program files (x86)\python38-32\lib\traceback.py&quot;, line 163 in print_exc
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydev_bundle\pydev_log.py&quot;, line 130 in _pydevd_log_exception
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydev_bundle\pydev_log.py&quot;, line 160 in exception
    File &quot;c:\Users\ericj\.vscode\extensions\ms-python.python-2020.9.112786\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_trace_dispatch_regular.py&quot;, line 462 in __call__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 101 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
    File &quot;C:\Users\ericj\.virtualenvs\django_appelent_api-8qkCZVAS\lib\site-packages\authlib\integrations\base_client\base_oauth.py&quot;, line 105 in __getattr__
  </code></pre>
  <p>This registers some oauth credentials (info) that can be used using the <code>oauth</code> variable (for example <code>oauth.get_authorization_url()</code> which gets me the authorize URL for that Oauth Provider.</p>
  <p>Now, I have a lot of different files (I split my views.py into multiple files). How can I access this oauth variable in those files? I have tried with django caches, but then I get a weird overflow error when I try to access the variable.</p>
  <p>How would you recommend?</p>
  <p>The oauth class is working fine locally in the file, I just need to transfer it to some other file</p>