Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6060191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:47:51+00:00 2026-05-23T08:47:51+00:00

I’m new to Django and MVT, so I apologize if this is a silly

  • 0

I’m new to Django and MVT, so I apologize if this is a silly question. I’ve looked over some similar questions but am looking for a little additional clarity and whether I’m even attempting to do the right thing.

Here’s a simplified version of what I’m working on. Let’s say I’m designing a Django interface to a pre-existing database. The database is old and other systems add data to it. The Django interface will be read only. Simple structure with 4 content tables:

  1. Widgets
  2. Creators (for simplicity, each Widget has one Creator)
  3. Customers
  4. Orders (customer many-to-many orders, orders many-to-many widgets)

I started by creating a Django app called “Widget” that displays Widget information, and creating models for all of the tables in the database. This works great, with an url like /widget/1234 I get the information for Widget with id 1234, info from the Creator table, and how many times it has been ordered.

Now I wanted to create an app called “Customer” that displays information for customers (data from Customer table, orders placed, widgets ordered, etc).

Am I doing the wrong thing? Should there be a separate “Customer” app?

If it does indeed make sense for there to be a separate “Customer” app, what do I do about the models? They are identical to the models used in the “Widget” app as they are dealing with the same tables in the same database. Do I just import from the other app? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:47:51+00:00Added an answer on May 23, 2026 at 8:47 am

    No, you do not need to create a separate app for each model. You should create an application for each distinct set of functionality in your project. Since you’re just learning, you should create one application (with the name of your project) and use that to learn.

    As for the models, they are just a representation layer of the tables in your db that makes it easy and handles a lot of the heavy lifting associated with interacting with your db. So in your case you would create a model for each table in your existing db: Widget, Creator (you may want to consider making this a foreign key link to your User table), Customer, Order.

    The way you return specific data is through your views. So for example to get all the data for a specific widget using the url in your example, the url /widget/1234 would point to a function on your views.py page where you would query your db for the information you need, and send it to your template. In your example the query would look something like:

    widget = Widget.objects.get(id=1234)
    

    Note that since you have an existing database you will have to override Django’s default db naming conventions. You can read more about how to do that here: https://docs.djangoproject.com/en/dev/topics/db/models/

    However the best advice I can give you would be to put your own project/app aside for a couple of days and go through the official Django tutorial and documentation. Especially when you’re first learning, its incredibly well documented and easy to learn:

    https://docs.djangoproject.com/en/dev/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.