Moved database model to django framework