code: def get_model(app_label, model_name):
      
      try:
          return apps.get_model(app_label, model_name)
      except AppRegistryNotReady:
          if apps.apps_ready and not apps.models_ready:
              # If the models module of the considered app has not been loaded yet,
              # we try to import it manually in order to retrieve the model class.
              # This trick is usefull in order to get the model class during the
              # ``apps.populate()`` call and the execution of related methods of AppConfig
              # instances (eg. ``ready``).
  
              # Firts, the config of the consideration must be retrieved
              app_config = apps.get_app_config(app_label)
              # Then the models module is manually imported
              import_module('%s.%s' % (app_config.name, MODELS_MODULE_NAME))
              # Finally, tries to return the registered model class
              return apps.get_registered_model(app_label, model_name)
          else:
              raise
docs: Given an app label and a model name, returns the corresponding model class.