How to rename all django's default auth, permi

2019-07-25 20:15发布

I am working on a django app. I understood django creates some tables for users, permissions, groups in database. In that database, already another django app is running. so, already it has default tables. Now, I need to create other app in same database. But I think it creates conflict on users,groups,permissions. So, I want to create all tables with some other names.

Updated I looked at django-table-prefix which doesn't work with 1.8+ .I am using django 1.10

My question is

How to create/migrate django app with different table names for users,groups, permissions or is there any other way?

Sorry for my silly question. Thanks

1条回答
Lonely孤独者°
2楼-- · 2019-07-25 20:47

If you have an existing Django project, which creates the default tables, you can just add a new **app* to the project. The app can be dependent upon those tables or not, depending on the functionality of the app. Here's the section on Django's website that discusses projects versus apps: https://docs.djangoproject.com/en/1.10/intro/tutorial01/#creating-the-polls-app.

Advanced Use: Here's the section on how to write reusable apps. https://docs.djangoproject.com/en/1.10/intro/reusable-apps/

I hope this helps.

查看更多
登录 后发表回答