Django models update when backend database updated
You don't need to update models if you just added new data. Models are related to a database structure only.
I am relatively new to Django.
I have managed to create a basic app and all that without problems and it works fine.
The question probably has been asked before.
Is there a way to update existing Django models already mapped to existing databases when the underlying database is modified?
To be specific, I have mysql database that I use for my Django app as well as some standalone python and R scripts. Now, it is much easier to update the mysql database with, say, daily stock prices, everyday from my existing scripts outside Django models. Ideally, what I would like is to have my Django models that are already mapped to these tables to reflect the updated data.
I know there is $ python manage.py inspectdb for creating models from existing databases. But that is not the objective.
From what I have gathered so far from the docs and online searches, it is imperative to update the backend database through Django models. Not outside of it. Is it the case really? As long as the table structure doesn;t change I really don't see the why this should not be allowed. Database is meant to serve multiple customers isn't it? With Django being one of it.
And I can not provide a reproducible example as it is a conceptual question.
If this functionality doesn't exist, imho, it really should.
Thanks,
Kaustubh