On Wed, 2006-08-16 at 22:36 -0700, Gary Wilson wrote: > James Bennett wrote: > > The more I think about it, the more I like the idea of using imports > > in __init__.py to specify an application's dependencies; the thing > > that'd make it especially nice would be some method -- either > > conventional or built straight in to Django -- of checking for > > "importable" versus "installed" and for throwing nicer error messages. > > Something like this, maybe: > > > > from django.conf import settings > > > > dependencies = ( > > {'name': 'tags', 'module': 'foo.tags'}, > > {'name': 'todo', 'module': 'bar.todo'}, > > {'name': 'comments', 'module': 'django.contrib.comments'}, > > ) > > IMO, the dependency checking is the easy part. In the README or > something, I say MyCoolApp requires the admin app. It's the > configuration settings of the admin app that's hairy.
And that is part of setting up the admin app, not part of the modularity of some other application. James' suggestion (and a lot of this thread) has been addressing the identification of the dependencies, not being an automatic project adiministrator. > So let's say MyCoolApp needs the admin app to function. [...] > So, in MyCoolApp.__init__.py I put the > following: > > dependencies = ( > {'name': 'admin', 'module': 'django.contrib.admin'}, > ) > > What has this bought me? Quite a lot, in terms of checking that the right pre-req is installed. If you don't have the admin app installed, you will find out that you need it as soon as you run "./manage.py validate" or "...syncdb". It's not meant to save you the work of installing the admin app, which seems to be the bulk of your post, but it automatically checks that you have it installed (or at least attempted to install it). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---