[英]How to rename all django's default auth, permission,groups tables?
I am working on a django app. 我正在开发Django应用程序。 I understood django creates some tables for users, permissions, groups in database.
我了解django在数据库中为用户,权限,组创建了一些表。 In that database, already another django app is running.
在该数据库中,已经有另一个django应用程序正在运行。 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 更新我看了django-table-prefix在1.8+上不起作用。我正在使用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? 如何使用用户,组,权限的不同表名创建/迁移django应用程序,或者还有其他方法吗?
Sorry for my silly question. 对不起,我这个愚蠢的问题。 Thanks
谢谢
If you have an existing Django project , which creates the default tables, you can just add a new **app* to the project. 如果您已有一个创建默认表的Django 项目 ,则只需向该项目添加一个新的** app *。 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 .
这是Django网站上讨论项目与应用程序的部分: 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/
https://docs.djangoproject.com/en/1.10/intro/reusable-apps/
I hope this helps. 我希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.