So it seems a sitecustomize.py is something internal to your company, and
you are proposing to document this for Django in general. So that shouldn't
be in there, right?

Also, although circular dependencies are probably a sign of a less than
perfect design, reality isn't perfect and they sometimes happen. Django
allows them just fine, so its docs should not say that some kinds of
dependencies are not allowed. They are.

Also, projects can be apps themselves. You can have your project's package
in INSTALLED_APPS, and I believe that that is in fact a pretty common
pattern. In particular, in the situation that you describe where you test
an app using its own settings.py, you are using the app as a project and an
app at the same time.

Also apps *may* be re-usable, and if they are then it is nice if they have
instructions for settings somewhere, but I don't see that as part of an
explanation of what an app is.

The current docs ( https://docs.djangoproject.com/en/dev/ref/applications/
) say "A project is defined primarily by a settings module." and "The term
*application* describes a Python package that provides some set of
features. Applications may be reused in various projects."

And I feel that getting more specific than that means that you probably
forget uses case that people use in production.

To me, apps are equivalent to modules. There are many reasons to divide
code into modules (your original module becomes too large, you want to
reuse parts of your code, you want to make dependencies explicit, etc). For
instance, you may want to split your models module, or your urls module, or
your views module. It usually makes sense to divide them together, because
they are often coupled. So that becomes an app.

Greetings,
Remco Gerlich


On Thu, Nov 19, 2015 at 10:54 AM, guettli <guettl...@thomas-guettler.de>
wrote:

> I created a ticket to find a better definition of "Project" vs "App"
>
> https://code.djangoproject.com/ticket/25748
>
> I am happy since Tim Graham accepted it.
>
> Here are the current docs:
> https://docs.djangoproject.com/en/1.8/ref/applications/#projects-and-applications
>
> Here is my view of Project" vs "App". It would be nice to find a consensus
> and update the docs.
>
> Project
> ======
> A project is a container for apps.
> 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.
> It is common that there is only one production installation of one project.
> It is common to have several stages (dev, test, prod) for one project.
> A project might contain a sitecustomize.py
>
> App
> ===
> An app can have models, views and code.
> It should be re-usable.
> An app can depend on other apps.
> It must not depend on a project.
> An app can contain a settings.py for testing, but it contains 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.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/1a7e8d69-1970-4b07-b820-90c4d652486b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/1a7e8d69-1970-4b07-b820-90c4d652486b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFAGLK3MwcHzxJsU06G79Vnbuf-4z0pHFJKx_qSLekYNHu%2B1Yw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to