# link custom admin page to button

**URL:** <https://forum.djangoproject.com/t/link-custom-admin-page-to-button/27440>\
**Category:** The Admin\
**Created:** [January 27, 2024, 7:49am UTC](https://forum.djangoproject.com/t/link-custom-admin-page-to-button/27440 "2024-01-27T07:49:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fah1r4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/fah1r4/32/18737_2.png) [@fah1r4](https://forum.djangoproject.com/u/fah1r4)\
**Post date:** [January 27, 2024, 7:49am UTC](https://forum.djangoproject.com/t/link-custom-admin-page-to-button/27440/1 "2024-01-27T07:49:32Z")

</div>

I need two admin sites (one with all models, one with auth user model & my profile model). I have created my second site and now, I want to link my second site to a button but I am not sure of how and would appreciate any help!!

profiles/admin.py  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/3/c/3ce60e4d9a0ebe1ae9243533f75f99c08395fc56.png)

mysite/urls.py

> from profiles.admin import staff\_site

> urlpatterns = [  
> path(‘staffadmin/’, staff\_site.urls)  
> ]

templates/face\_login.html

> div  
> a href=“{% url ‘admin:index’ %}” class= “btn btn-outline-secondary btn-sm”\>Administration /a  
> /div

currently, I have the URL linked to the original admin index page and it works but unsure of how to implement it for my second site…

---

<div class="post-metadata">

**Author:** ![antoinehumbert](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/antoinehumbert/32/14851_2.png) [@antoinehumbert](https://forum.djangoproject.com/u/antoinehumbert)\
**Post date:** [January 27, 2024, 8:20am UTC](https://forum.djangoproject.com/t/link-custom-admin-page-to-button/27440/2 "2024-01-27T08:20:56Z")

</div>

Hi. As mentioned in the documentation (see [The Django admin site | Django documentation | Django](https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#multiple-admin-sites-in-the-same-urlconf)), what you are looking for is the purpose of the `name` parameter passed on admin site instanciation.

So, in you’re case, the url can be reversed by using `StaffAdmin:index` instead of `admin:index`

---

<div class="post-metadata">

**Author:** ![fah1r4](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/fah1r4/32/18737_2.png) [@fah1r4](https://forum.djangoproject.com/u/fah1r4)\
**Post date:** [January 27, 2024, 10:43am UTC](https://forum.djangoproject.com/t/link-custom-admin-page-to-button/27440/3 "2024-01-27T10:43:43Z")

</div>

omg it worked, thank you so much!!!

i did try staffadmin too but I didn’t capitalise it cause admin was not Admin and it did not cross my mind and I just realised I named it StaffAdmin…
