jul
jul

Reputation: 37464

How to modify the app name in Django admin's urls?

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.

Upvotes: 4

Views: 2166

Answers (1)

alecxe
alecxe

Reputation: 473833

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.

Upvotes: 1

Related Questions