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

  • SEARCH
  • Home
  • 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 6065857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:26:17+00:00 2026-05-23T09:26:17+00:00

Currently i have my models, views, forms in default file. But i want to

  • 0

Currently i have my models, views, forms in default file.
But i want to have directory structure like

articles
---------models
---------views
---------forms

Books
---------models
---------views
---------forms

Icecreams
---------models
---------views
---------forms

so that i keep separately but i don’t want different app

  • 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-23T09:26:17+00:00Added an answer on May 23, 2026 at 9:26 am

    The directory structure you describe is the individual apps directory structure. If you want it to look like that, you have to make them separate apps. However, you can do something like:

    myapp/
        __init__.py
        models/
            __init__.py
            articles.py
            books.py
            icecream.py
    

    Simply add a models directory and delete models.py. Then, create a separate .py file for each model/group of models you want to separate.

    Here’s the important part: on each of your models you must add the following to their Meta class:

    class MyModel(models.Model):
        ...
        class Meta:
            ...
            app_label = 'myapp'
    

    Where ‘myapp’, is the main app folder all these models are stored in.

    Then, edit models/__init__.py and import all your models there, e.g.:

    from .articles import Article
    from .books import Book
    from .icecream import IceCream
    

    However, the models you list as examples are pretty obvious candidates for distinct apps. The approach above is really only for related models. If your models are truly that distinct, they should be individual apps.

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

Sidebar

Related Questions

I currently have the following models/toy.rb file in my RoR project: class ToysPurchased include
I currently have a ModelForm set up in Django, but would like to make
I have a system that relies on other models but want to make it
In the Rails application I’m currently developing I have many request models. We are
I'm currently managing multiple models from a single SITE MANAGER page. I have the
Currently I am have a comment which belongs to a micropost, but the issue
I have a table with the following structure GUID uniqueidentifier with default value newid(),
I currently have a DetailView for Django's built-in User . url( r'^users/(?P<pk>\d+)/$', DetailView.as_view( model
I have a model User . The model currently works with a Register view
I currently have a client that wants me to 'abstract' out a domain model

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.