# model definition - admin only

**URL:** <https://forum.djangoproject.com/t/model-definition-admin-only/36058>\
**Category:** Getting Started\
**Created:** [October 29, 2024, 6:13pm UTC](https://forum.djangoproject.com/t/model-definition-admin-only/36058 "2024-10-29T18:13:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbhrfx9280](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jbhrfx9280/32/15247_2.png) [@jbhrfx9280](https://forum.djangoproject.com/u/jbhrfx9280)\
**Post date:** [October 29, 2024, 6:13pm UTC](https://forum.djangoproject.com/t/model-definition-admin-only/36058/1 "2024-10-29T18:13:35Z")

</div>

Django: 5.1.1  
python: 3.12.5

I have never needed to do this before.  
I have searched the forum and of course online and nothing.

Question 1:  
I need to create a new database model that will only be **edited** in Django admin. It will be **accessed** in various apps, but **not edited**. Where do I define the model at? When it’s for an app I define it in the local models.py. This model is not app specific. So where do I define it?

Question 2:  
Usually when you define a model that you want access to in Django admin you reference it in the apps admin.py file. Since this is only **edited** in Django admin where do I reference it at? What **admin.py** file would that be in?

Question 3:  
Based on your **answer(s)** above would I reference that location only from any app I need to read data from in this model?  
i.e.: from app\_name.models import ManagerMessaging

sample model class name  
class ManagerMessaging(models.Model):  
🙂

---

<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:** [October 29, 2024, 6:16pm UTC](https://forum.djangoproject.com/t/model-definition-admin-only/36058/2 "2024-10-29T18:16:47Z")

</div>

Models are models. It doesn’t matter how they’re used, they’re always defined and accessed the same way.

How you use those models are up to you. There’s nothing preventing you from creating a model that is only used by the admin. It’s still going to be defined in a models.py file in an app.

Structurally, there will be nothing different about this model from any other model you define.

---

<div class="post-metadata">

**Author:** ![jbhrfx9280](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jbhrfx9280/32/15247_2.png) [@jbhrfx9280](https://forum.djangoproject.com/u/jbhrfx9280)\
**Post date:** [October 29, 2024, 6:20pm UTC](https://forum.djangoproject.com/t/model-definition-admin-only/36058/3 "2024-10-29T18:20:08Z")

</div>

Hi Ken,  
So can I define a models.py file at the project level and only use that for these types of needs? I don’t even see an admin.py file there. if not where do u suggest it should go based on your experience?

Thank you  
John

---

<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:** [October 29, 2024, 6:24pm UTC](https://forum.djangoproject.com/t/model-definition-admin-only/36058/4 "2024-10-29T18:24:47Z")

</div>

> [@jbhrfx9280](#):
>
> So can I define a models.py file at the project level

No, they still need to be defined in an app.

Same as your admin.py

There is **no** difference in how you create models based upon how they’re being used. (You could even define a model that isn’t used anywhere in your project. It doesn’t change how those models are managed.)
