0

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 1

3

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/

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you, and apologize as can't up-vote due to my low reputations.
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?
Thank you I found answer for my problem! amvtek.com/blog/posts/2014/Jun/13/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.