user805981
user805981

Reputation: 11059

What is the right way to organize a Django Project?

I'm new to Django and I'm trying to wrap my head around how these apps are supposed to be organized. I have the following questions:

  1. Are apps like divs that are generated separately?

  2. Can we have apps within apps?

  3. Can we have apps that when clicked on, change other apps with javascript?

  4. Right now I just have one views.py file and it loads all of its content through different function calls.

    So right now I'm faced with if I should break up my views.py into smaller apps. Am I going about Django the correct way?

  5. Are apps defined like the they are in picture below, or are apps supposed to act more like a page?

  6. What if I want a header, breadcrumbs, and footer for all my pages? I'm super confused @.@

enter image description here

Upvotes: 1

Views: 362

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599610

Apps have nothing whatsoever to do with divs. Django is not a CMS (although it can be used to create CMSs) and doesn't dictate the layout of your templates.

The usual way to handle different blocks on the page that need different logic to populate them is via custom template tags. James Bennett has a good writeup on this, although the syntax is rather out of date so refer to the first link for that.

Upvotes: 4

Related Questions