-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Aymeric,

On 10/11/2011 06:12 AM, Aymeric Augustin wrote:
> The new structure highlights that a Django project is:
> - an entrypoint for scripts manage.py — and soon another one for WSGI servers,
> - a settings module and a root URLconf, who happen to live in the same
> package by default,
> - some applications, templates, static files, etc.
> 
> I was about to ask a question about the recommended project layout but
> I eventually found the answer here:
> https://github.com/carljm/django/commit/4ba999060d8c030dd43ef4a8ec2844850f0310b3#L2R380
> 
> This information will still be interesting and useful long after the
> 1.4 release. Shouldn't we move it somewhere in the documentation and
> link to that page from the release notes?

Yes, I think adding a bit more detailed information about project layout
and Python path issues to the documentation makes sense.

> Also, following the Zen of Python, shouldn't we recommend the
> decoupled style (ie. put apps in the outer "mysite" directory)?

With my proposed patch we already implicitly recommend this by modeling
it in the tutorial, but we don't explain it particularly.

Personally I don't think it's as simple as a universal recommendation.
In practice I find that some apps are potentially destined for reuse,
and with those I prefer to start out with a top-level namespace. A few
(often those containing core content models) are inextricably tied to
the particular site/project, and for those I prefer to namespace them
inside the project namespace.

I'm not sure if that level of discussion belongs in the documentation or
not. I can try and see how it reads.

> Finally, if I understand correctly, the only reason why the default
> settings and URLconf are in a package ("mysite.settings" and
> "mysite.urls") is to avoid name conflicts. In particular, it makes it
> possible to run several Django projects in parallel with the same
> PYTHONPATH. It'd be worth mentioning this in the documentation, so
> that newcomers understand there's nothing magic with the name of the
> inner "mysite" directory.

Yeah - that's tricky to describe in the docs, since you still can't run
multiple Django projects in parallel *in a single process* (until we get
rid of settings as a process-global), but it does allow you to run
multiple projects in different processes using the same PYTHONPATH
setup. I can try to discuss this as well and see how it looks.

> I believe all this could go either in the tutorial or in a new page
> dedicated to project layout — the latter would allow us to give more
> details on the project layout options.

I think we should add a dedicated "Python path and project layout" page,
and link to it from the tutorial and elsewhere. This gets way too
complex to load onto beginners right away in the tutorial.

Carl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6UetEACgkQ8W4rlRKtE2eTxgCfYbzpvkYU5BIY87U4QU5Ucf/A
dWUAmQFtfgluu0Ubf/RXaK9X+f3DD3sd
=4v8O
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to