Q:

What is the equivalent of django.db.models.loading.get_model() in Django 1.9?

I want to use get_model() to avoid cyclic imports in my models, but I get name 'get_model' is not defined error. I read that get_model() was depreciated in 1.8 and apparently is not present in 1.9. What is the equivalent call? Or is there another way to avoid cyclic imports in two models.py files?

A:

django.db.models.loading.get_model() has been removed in django 1.9.
You are supposed to use django.apps instead.
>>> from django.apps import apps
>>> apps.get_model('shop', 'Product')
<class 'shop.models.Product'>
>>> 

Django docs reference

