Search code examples
pythondjangotornado

How to import Django Model to Tornado project?


I have an app written by Django. Then I want to develop a new app by Tornado which uses the Django's Model to provide data for client.

I have found this:Using Django Inside the Tornado Web Server

But in the blog, the author just give the code that we should define the Django Model again in Tornado project.

How do I do that we can import the defined Model in Tornado project avoiding repeating define. help!


Solution

  • You have to do from django.conf import settings first. After that you can import your models and work with them like usually.