Django Admin Interface - Application Custom Name

Using "app_label" in "Class Meta" will solve this problem. But when creating the syncdb command, it will not create tables. Because the application name does not match the INSTALLED_APPS entry. Is there any way to achieve both (the name of the user application and the creation of tables using syncdb)

+6
django admin
source share
1 answer

I have not tried this, but there is a solution here that should allow you to change the application shortcut when working with syncdb .

 class model_module1(models.model): [...] class Meta: app_label = "Cool module name" db_table = "module1_model" class model_module2(models.model): [...] class Meta: app_label = "Cool module name" db_table = "module2_model" 

This makes sense, as the table name becomes explicit, so when you run syncdb there is no guessing . The disadvantage is that these two Meta options must be specified in each application model.

0
source share

All Articles