On Oct 8, 9:51 am, Brent Hagany <[EMAIL PROTECTED]> wrote:
> I'm not in front of my code at the moment, but I'm pretty sure there's
> no magic involved, and it works just fine.  When I do a runserver from
> my (completely decoupled) project, the root urlconf sends everything
> to umbrella.urls, which then delegates once again to
> umbrella.app.urls, which knows where to find the views, and the views
> know where to find the models.  Everything just looks for the parts
> they need, relative to umbrella.  That's not magic, is it?

No, but it's only half- working.  Ever try a "syncdb" since you did
this rearrangement?  It won't find your models.  And if you try to use
the admin, it won't find them either.  Bottom line is, it's not
correctly configured.  A properly configured app needs to have a
models module, and needs to be in INSTALLED_APPS.  "umbrella" is not
an app, and your other apps aren't actually installed because they
aren't in INSTALLED_APPS.

> In any case, I will try the umbrella.* thing.  Will that try to put
> things like umbrella.urls and umbrella.templates into INSTALLED_APPS,
> too?

Assuming umbrella.urls is a urls.py file, not a urls/ package
directory, it won't try to load that (it only loads subdirectories).
I haven't tested, but it probably will try to load your templates
directory, and may fail somewhere down the line because it isn't a
Python module.  If you use umbrella.*, it's really not advisable to
have anything but the apps themselves in the umbrella directory.

Also, if the apps are really so tightly coupled that they could never
be used apart from each other, I'd question the value of having them
be separate apps at all.  It sounds more like you have one app.  If it
has too many e.g. models to want to put them all in one models.py, you
could look at splitting up your models.py into a models/ package.  The
point of splitting out separate reusable apps is that they address a
single well-defined concern, and you can actually reuse them
independently of each other.

Carl

--~--~---------~--~----~------------~-------~--~----~
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