如何重命名所有django的默认身份验证,权限,组表? [英] How to rename all django's default auth, permission,groups tables?
问题描述
我正在开发Django应用程序。我了解django在数据库中为用户,权限,组创建了一些表。在该数据库中,已经有另一个django应用程序正在运行。因此,它已经具有默认表。现在,我需要在同一数据库中创建其他应用程序。但是我认为这会在用户,组,权限上造成冲突。因此,我想使用其他名称创建所有表。
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.
已更新
我看着django-table-prefix,它没有不能与1.8+一起使用。我正在使用django 1.10
Updated I looked at django-table-prefix which doesn't work with 1.8+ .I am using django 1.10
我的问题是
如何为用户,组,权限使用不同的表名创建/迁移django应用程序还是还有其他方法?
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
推荐答案
如果您已有一个创建默认表的Django 项目,则可以向项目添加一个新的** app *。该应用程序可以取决于这些表,也可以不取决于这些表,具体取决于该应用程序的功能。这是Django网站上讨论项目与应用程序的部分: https://docs.djangoproject.com/en/1.10/intro/tutorial01/#creating-the-polls-app 。
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.
高级用法:这是有关如何编写可重复使用的应用程序的部分。 https://docs.djangoproject.com/en/1.10/intro/reusable -apps /
Advanced Use: Here's the section on how to write reusable apps. https://docs.djangoproject.com/en/1.10/intro/reusable-apps/
我希望这会有所帮助。
这篇关于如何重命名所有django的默认身份验证,权限,组表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!