On Tue, 2008-04-15 at 08:23 +0100, andy baxter wrote:
> James Bennett wrote:
> > On Fri, Apr 11, 2008 at 1:09 PM, andy baxter
> > <[EMAIL PROTECTED]> wrote:
> >   
> >>  What /should/ be inside the project folder?
> >>     
> >
> > I often get severely flamed for saying this, but:
> >
> > I very rarely have a "project folder". All it is is a place to stick a
> > settings file and a root URLConf module, both of which are just plain
> > old Python files which can live anywhere you can import from. So most
> > of the time I don't bother creating a folder just to do that; I only
> > do so when I have groups of configuration files that I want to
> > organize.
> >   
> Is there any strong reason why you /shouldn't/ do it the way in the 
> tutorial - e.g. security? Or is this just your preference?

No there isn't any reason like that and it is often a matter of
preference. The preference is whether your applications are likely to be
useful in other situations or not.

If you implement your applications as things that don't rely on being
inside a particular project directory, it will be much easier to reuse
them elsewhere.

Are all applications reusable? Probably not. I know I've built a few
projects where the applications were all pretty domain-specific. Now I
might be able to reuse those apps in a similar domain, but I'm not
seeing the immediate reuse right now. Still, it's worth designing them
to be able to operate outside of their original project directory so
that if something does come up, I can reuse them. It doesn't take much
effort up front and it does make things unintentionally easier down the
track. If you don't do this, no harm will come to you. It'll just be a
little harder to lift something from projectA and use it in projectB,
since you'll have a whole bunch of "projectA" directories mentioned in
import statements and the like.

I've rambled further on this topic in the past. See [1] and [2] if
you're interested.

[1]
http://www.pointy-stick.com/blog/2007/11/09/django-tip-developing-without-projects/
[2]
http://www.pointy-stick.com/blog/2007/11/14/django-tips-source-code-filenames/

Regards,
Malcolm



-- 
A clear conscience is usually the sign of a bad memory. 
http://www.pointy-stick.com/blog/


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

Reply via email to