Wednesday, August 24, 2016

Re: Clarifying Project vs Apps

My feeling/practice on apps is: each app is a one-word informative noun. It contains the models that are logically grouped under that noun (and the views, urls, etc required to interact with those models on the front end).

If there isn't a single word that logically represents all my models, then they need to be separated into multiple apps. (And if models.py has gotten long enough that it's unwieldy, it probably wants to be split.)

So, e.g., "companies" or "invoices" or "customers" or "reports" are all perfectly decent app concepts.

Also, _Two Scoops of Django_ is a helpful book for developing Django best practice intuitions.

On Wed, Aug 24, 2016 at 11:48 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:
  While I think that I understand the differences between a project and its
apps there remains one point of uncertainty. I've not found the answer,
although it might be in the 1.10 docs or on the Web and I've missed it.

  If the project represents the entire database, do the apps represent
individual tables? That is, should my project have a separate app for each
table with its models, templates, and views with templates of joined tables
in the main project subdirectory? Or are all tables in a single app?

TIA,

Rich




--
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology Association: http://www.lita.org

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFE1XCbixOV-66k-RwCYHb9io0UCyZ%2BJZx0asFvRiZWXioDL5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment