# App / Database structure

**URL:** <https://forum.djangoproject.com/t/app-database-structure/7154>\
**Category:** Using Django\
**Created:** [March 21, 2021, 5:05am UTC](https://forum.djangoproject.com/t/app-database-structure/7154 "2021-03-21T05:05:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveRoach](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/steveroach/32/3929_2.png) [@SteveRoach](https://forum.djangoproject.com/u/SteveRoach)\
**Post date:** [March 21, 2021, 5:05am UTC](https://forum.djangoproject.com/t/app-database-structure/7154/1 "2021-03-21T05:05:03Z")

</div>

Hi Guys,

I’m new to this but I’ve hit a bit of a wall. Any advice would be appreciated.

I am building an internal-only website using an Oracle database. I’ve created a Project and 2 Apps; MainApp & FileMgmtApp. Main would be my entry point / index and that will direct users to one of the various Apps where they do the real work. My database is already partly built and contains a dozen or so tables. The FileMgmtApp, so far, uses just one of those Oracle tables.

I have configured the database connection and used inspectdb to build the FileMgmtApp/models.py file. If I makemigrations, then migrate, and configure FileMgmtApp/admin to register the table I can see / maintain the table of interest. This all works well. However, I have some questions about how this should be structured.

When I ran inspectdb, Django didn’t just create a basic model, is also created 2 sets of tables in the database; those with the prefix AUTH, and those with the prefix DJANGO. It also created references to these in the model.py file along with my database application tables.

Couple of questions:

- Should the AUTH & DJANGO be in a more generic model? Maybe in the MainApp application? They seem to apply to the website generally. Or, if I create further Apps, do these tables turn up in each one’s model.py?
- Some of my application tables will be specific to an App I have yet to create. Should I remove references to them from this app before continuing?

I would like to kick off with a well-structured project and understanding this will help.

TIA.

---

<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:** [March 21, 2021, 3:58pm UTC](https://forum.djangoproject.com/t/app-database-structure/7154/2 "2021-03-21T15:58:28Z")

</div>

You probably shouldn’t have internally-defined models for the `auth_` and `django_` tables. They’re for internal use by Django and you probably don’t want to mess with them at all. I’d remove them from any models.py file I’m getting from an inspectdb.

---

<div class="post-metadata">

**Author:** ![SteveRoach](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/steveroach/32/3929_2.png) [@SteveRoach](https://forum.djangoproject.com/u/SteveRoach)\
**Post date:** [March 22, 2021, 10:50am UTC](https://forum.djangoproject.com/t/app-database-structure/7154/3 "2021-03-22T10:50:15Z")

</div>

Hi Ken,

Thanks for that. I didn’t want to remove them in case I trashed something. I’ll remove them.

Thanks for your time.
