Search code examples
pythondjangodjango-modelsdjango-rest-frameworkactive-model-serializers

Using models between an App and API app in Django Rest framework


I'm going to create API with Django Rest Framework for an existing Django project. I would like to use models of existing app (product/models.py) in 'API/models.py'. Will that work smoothly as of using models across multiple apps using from product.models import item,...

After importing I'll be creating serializers.py .

Can anyone answer me whether this will work?


Solution

  • Yes, this works, we can import and use models of other apps in this way.