I've got a Postgresql databese with data. I wish to produce a django application with this database.

How do i import the tables to django models and/or sights?

Look at this: http://docs.djangoproject.com/en/dev/howto/legacy-databases/

There's a software application to create models out of your existing database. It really works pretty much.

In case your database is not so simple -- or perfectly designed -- its an undesirable match Django.

As the reverse engineering is effective, you might find the original database design was problematic and you've got plenty of clumsy workarounds.

Now you ask , among "legacy software" that actually works using the old data model.

I'd suggest you need to do the next.

  1. Design the right data model, using Django.

  2. Map the right model to anything you've.

  3. Write a conversion script that utilizes simple, direct SQL and also the Django ORM emigrate data from non-Django-friendly to some better model.

    • For those who have legacy software, you will need to exercise a suitable data movement schedule.

    • Without having any legacy software, you'll run this conversion once.