Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#25748 closed Cleanup/optimization (fixed)

Glossary: Project vs App

Reported by: Thomas Güttler Owned by: nobody
Component: Documentation Version: 1.8
Severity: Normal Keywords:
Cc: carsten.fuchs@…, zachborboa@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There are several blog posts and stackoverflow answers about this topic:

"Project" vs "App".

I would like to see an official statements about these terms.

I checked the current docs and could not find a definition. I hope I was not blind :-)

What is an "app" and what is a "project"?

Here is what I tell new team mates:

Project: A project is a container for app. It contains only settings, no database models. Since it contains no database models it does not contain database schema migrations. It can contain migrations which fill a database with project specific data. A project might contain a sitecustomize.py

App: An app has models, views and code. It should be re-usable. An app can depend on an other apps. It must not depend on a project. An app can contain a settings.py for testing, but it has no settings on its own. It should have instructions which settings are needed to get the app running in a project. A app must not contain a sitecustomize.py.

Change History (12)

comment:2 by Thomas Güttler, 9 years ago

I have not found that with before. I added above link to the relevant questions at stackoverflow.

Still I think this part could be improved to be more explicit.

What is wrong with my above definition? Could it be added to the docs?

Version 0, edited 9 years ago by Thomas Güttler (next)

comment:3 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

I'm not familiar with sitecustomize.py so I think that would need to be explained. I'm not sure if it's something that Django needs to discuss or not. Apps aren't necessarily reusable -- some are meant to be reuseable but others aren't. I think the startapp and startproject commands give a good idea about what each thing is but feel free to submit a pull request if you'd like to suggest some improvements.

comment:4 by Carsten Fuchs, 9 years ago

Cc: carsten.fuchs@… added

comment:5 by Zach Borboa, 9 years ago

Cc: zachborboa@… added

comment:7 by Thomas Güttler, 9 years ago

I created a pull request to improve the docs: https://github.com/django/django/pull/5788

comment:8 by Tim Graham, 9 years ago

Has patch: set

Another try: PR

comment:9 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In e0519301:

Fixed #25748 -- Added clarification on projects vs. applications.

Thanks Thomas Güttler for motivating this addition.

comment:10 by Tim Graham <timograham@…>, 9 years ago

In 406acd6:

[1.9.x] Fixed #25748 -- Added clarification on projects vs. applications.

Thanks Thomas Güttler for motivating this addition.

Backport of e0519301238b43633bab64054772f9a62634a05f from master

comment:11 by Thomas Güttler, 9 years ago

Follow up: #26032

comment:12 by Thomas Güttler, 8 years ago

Just for the records: a virtualenv can't provide a custom sitecustomize.py. This works on some linux distributions, but not on all. Some distributions provide a global sitecustomize. Use usercustomize instead.

Note: See TracTickets for help on using tickets.
Back to Top