4

In a Django app the urls of the admin contains the app name, ex:

http://my.domain.com/admin/myapp/mymodel

How can I replace myapp by another string (without modifying the actual app name of course)?

EDIT

My db already exists, so I can't use app_label in my models' META. I just want to modify the app name displayed in the admin urls and the admin pages.

jul
  • 36,404
  • 64
  • 191
  • 318
  • There seems to be only answers for the models, but what about the admin login page `http://my.domain.com/admin/myapp/`? Isn't there a global way to do that? – jul May 27 '13 at 09:19

1 Answers1

1

One way is to set app_label on each model of your app by defining an abstract model, like it's done here. If you have an existing database, as a workaround, you can override db_table on each model as suggested here.

Another option is to use awesome django-admin-tools module, that is very powerful at customizing your admin site. You can define your own DashboardModule and customize links as you want.

Also see:

Hope that helps.

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • This is only for models. This does not change the admin login page `http://my.domain.com/admin/myapp/` for instance. Isn't there a global way to do that? Using `django-admin-tools` is not an option. – jul May 27 '13 at 09:21
  • `app_label` is used by the model managers, so since my DB already exists, I can't modify it. – jul May 27 '13 at 09:30
  • Agreed, what about overriding admin templates - is that an option for you? – alecxe May 27 '13 at 09:31
  • That's an option, but what about the urls? – jul May 27 '13 at 09:34