tags:

views:

406

answers:

1

I have an application in production with a sub-standard admin interface. The app is written in PHP and is backed by PostgreSQL.

I have briefly tinkered with Django and am very impressed with how easy it is to get an admin interface up and running.

Can someone more experienced with Django please comment on:

  • Can I have Django build an admin app around my existing schema with similar ease? And if so,
  • Would you recommend it / are there any gotchas?

One gotcha I can see is that I'll be maintaining two models: one written in Python and one in PHP. The speed with which one can get an admin interface up-and-running with Django though, makes it very tempting.

Thanks Harry

+6  A: 

You can create django site that is linked to an existing database by using manage.py's inspectdb command, and then add admin functionality to the resulting models.

I haven't tried this, but I used inspectdb output to access some phpbb tables via Django and it seems to work fine.

You can encouncer problems if the app's own admin interface does more than simple CRUD (such as updating denormalized fields in other tables and so on). It may be less pain to improve current admin interface than to reproduce these things in the new one (not to mention what would happen if you needed to change their logic in the future).

che
You will probably have to do some tinkering with the generated models.py file. Make sure that the classes are in the correct order, make sure that all of the primary keys are correct, etc.
Michael Warkentin