Django REST Framework share class instance between files
问题 I have some code in my apps.py's ready() method that loads some Oauth providers using the authlib module. Basically I am doing this (apps.py): 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