# how to add to admin.py 3 or more models?

**URL:** <https://forum.djangoproject.com/t/how-to-add-to-admin-py-3-or-more-models/5259>\
**Category:** Using Django\
**Created:** [November 18, 2020, 10:13am UTC](https://forum.djangoproject.com/t/how-to-add-to-admin-py-3-or-more-models/5259 "2020-11-18T10:13:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anastasiyamykolenko](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anastasiyamykolenko/32/2459_2.png) [@anastasiyamykolenko](https://forum.djangoproject.com/u/anastasiyamykolenko)\
**Post date:** [November 18, 2020, 10:13am UTC](https://forum.djangoproject.com/t/how-to-add-to-admin-py-3-or-more-models/5259/1 "2020-11-18T10:13:57Z")

</div>

How add to admin.py admin.register for 3 model: Page/PageAdmin/PageListing?  
Below screenshot from my code:  
 ![126235511_159255999237188_6259786629808175105_n](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/2/2ea51ae9057e2f2ac6dde322e077906f69d56917.jpeg)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 18, 2020, 12:51pm UTC](https://forum.djangoproject.com/t/how-to-add-to-admin-py-3-or-more-models/5259/2 "2020-11-18T12:51:42Z")

</div>

If you have three different **models** with the name Page, PageAdmin and PageListing (and not three **views** that all display the same model), then you would register each of those models using the admin decorator.

```auto
from django.contrib import admin
from .models import Page, PageAdmin, PageListing

admin.site.register(Page)
admin.site.register(PageAdmin)
admin.site.register(PageListing)

```

(You could also use the admin.register decorator with custom admin classes if necessary.)

Note: when you post code here, please do not post screenshots. Copy and paste your code here, and enclose it between lines consisting of only three backtick - ` characters. That means you’ll have one line of ```, then your code, then another line of ```. This preserves the formatting of the code making it a lot easier to read - especially with statements where indentation is critical.

example:

````auto
# The line above this is ```
def function(self):
    return self
# The line after this is ```

````

Ken
