开发者

Django with a legacy database

开发者 https://www.devze.com 2022-12-22 02:25 出处:网络
I need to build a dja开发者_如何学Pythonngo project on top of an existing database. I\'ll use inspectdb as explained in the django docs and then syncdb to create the django required tables.

I need to build a dja开发者_如何学Pythonngo project on top of an existing database. I'll use inspectdb as explained in the django docs and then syncdb to create the django required tables.

Is there a way to keep track of the django specific tables (admin permissions, content types...)? I want to be able to remove django completely in the future if needed.

Thanks


If you are using some django modules, then you can detect tables in schema, by looking for used app names and also for main django tables. These are:

django_admin_log
django_content_type
django_session
django_site

And for auth app from django:

auth_group
auth_group_permissions
auth_message
auth_permission
auth_user
auth_user_groups
auth_user_user_permissions

Just look for apps that you use from django and tables for those apps will have app name prefix. Those you must drop.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号