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

Hi Rich,

On 10/18/2011 04:21 PM, Rich Jones wrote:
> So I've just written a blog post about getting started with Django,
> http://gun.io/blog/python-for-the-web/, and many of the things here
> just make me think, 'why doesn't it just do that by default?'
> 
> Here's some of what I propose. I'm not suggesting this be a canonical
> list of features by any means, I'm just suggesting that django have
> more convenient default settings. We should look at the most common
> conventions and best practices and shape the defaults towards them.

Thanks for giving some thought to what would make Django easier for new
users.

> Anyway, I propose that:
> 
> django-admin.py startproject newproj
> 
> should create ./static, ./uploads and ./newproj and ./newproj/
> templates

+0.5 to creating static/ and templates/ directories. I know people may
use layouts where those live elsewhere, but I don't think I've ever seen
a real production Django codebase that didn't have a directory for
static assets and a main project-wide directory for templates, in the
same repo with the code.

- -1 to creating an uploads/ directory, I've seen (and written) many
projects that never handle user uploads at all.

> in ./newproj/settings.py..
> 
> import os
> TEMPLATE_DIRS = (
>     os.path.join(os.path.dirname(__file__), 'templates'),
> )

If startproject creates a templates/ dir, +1 to having it in the default
TEMPLATE_DIRS in a portable way like this.

Same with static/ and STATICFILES_DIRS.

> and at the end, the commonly used from local settings import * block.

- -1; this is often done, but it's far from a consensus best practice.

> I'd also suggest that django-admin.py startproject newapp, if
> possible, add the new application to the settings.py file if it can be
> done so safely.

I'd be -1 on this as well for the same reason as Javier.

> I would also suggest that when making a new application, the most
> commonly used imports are already there in the py files
> (render_to_response, HttpResonse, get_object_or_404, etc).

- -1 on this; I frequently have a views.py that doesn't use one or more of
these utilities (what if I prefer TemplateResponse instead of
render_to_response?). Users should get used to the idea that you import
what you actually need to use and don't have unused imports hanging around.

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

iEYEARECAAYFAk6eExEACgkQ8W4rlRKtE2cJAgCfdVEI4pysyolpayYs/oGvam20
WvIAnA34ivGF47ZczmCe/KAkHcqhhXAf
=lpHn
-----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