Is it possible to generate django models from the database? -


i've been messing around django , django orm @ home, , i've got say, feel 1 of best out there in terms of ease of use.

however, wondering if possible use in "reverse".

basically generate django models existing database schema (from project doesn't use django , pretty old).

is possible?

update: database in question oracle

yes, use inspectdb command:

inspectdb

introspects database tables in database pointed-to database_name setting , outputs django model module (a models.py file) standard output.

use if have legacy database you'd use django. script inspect database , create model each table within it.

as might expect, created models have attribute every field in table. note inspectdb has few special cases in field-name output:

[...]


Comments