douyinbo3361
2009-01-28 23:52 阅读 53
已采纳

Django可以为我的PHP应用程序的现有架构进行自动管理吗?

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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    duanpin5168 duanpin5168 2009-01-29 00:18

    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).

    点赞 评论 复制链接分享

相关推荐