There are currently several modules / apps that require auto discovery
based on whats listed in INSTALLED_APPS. admin, django_nav, and the
proposed startup.py and I know one or two other apps that use similar
methods but cannot remember their names off the top of my head.

I would like to propose a new setting AUTODISCOVER, an iterable of
module names to automatically load from each INSTALLED_APP after the
settings have been initialized. This would default to

AUTODISCOVER = (,)
_REQUIRED_AUTODISCOVER = ('startup',) #Assuming the startup.py
proposal is accepted

_REQUIRED_AUTODISCOVER is a separate setting in default_settings.py
that is combined with AUTODISCOVER during settings initialization

AUTODISCOVER = _REQUIRED_AUTODISCOVER + AUTODISCOVER

which will ensure the required auto discover modules are processed
first by the new autodiscover module

Currently each app / module that needs to be autodiscovered in some
way needs to re-implement something very similar to the admin
autodiscover @ 
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/__init__.py

I think the new module should be @ django.core.autodiscover, look like
http://dpaste.com/hold/201868/ and be loaded immediately after
settings initialization.

Obviously for backwards compatibility the current django.contrib.admin
autodiscover needs to remain and function as it did, but should be
modified to look like http://dpaste.com/hold/201874/ to prevent the
admin from attempting to register itself twice if admin is already
being loaded by the new autodiscover method.


Dj Gilcrease

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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