Sometimes is necessary to create database scripts and run it as a view in Django, but it could be hard, because you must manage the scripts outside the Django project structure.
To make it simple I've created a simple way to run those database view scripts integrated with django.
To make it possible, is necessary to create an engine to find and run these scripts inside the django apps. In your project create a file named db.py
and put the bellow code inside:
# coding: utf-8