I have already created a set of tables with Postgresql, I would like, to make a query directly from tables to Django views without writing any models to pose as a form?
1 Answer
You can use the inspectdb management command to automatically generate models from an existing database:
python manage.py inspectdb > models.py
For more information, see the official docs: https://docs.djangoproject.com/en/1.10/howto/legacy-databases/
3 Comments
Rekaut
Thank you, and apologize as can't up-vote due to my low reputations.
Rekaut
Hello J.McBride, this will only creating the models out of tables where they came with django! is there anyway to point to desired - created database or Schema?
Rekaut
Thank you I found answer for my problem! amvtek.com/blog/posts/2014/Jun/13/…