Django

Code

Show
Ignore:
Timestamp:
07/09/08 11:01:33 (6 months ago)
Author:
brosner
Message:

newforms-admin: Added autodiscover functionality to django.contrib.admin. This makes the admin aware of per-app admin.py modules and does an import on them when explicitly called. Docs show how this is used. Fixed #6003, #6776, #6776.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/docs/admin.txt

    r7684 r7872  
    610610    from django.conf.urls.defaults import * 
    611611    from django.contrib import admin 
     612     
     613    admin.autodiscover() 
    612614 
    613615    urlpatterns = patterns('', 
     
    615617    ) 
    616618 
     619Above we used ``admin.autodiscover()`` to automatically load the 
     620``INSTALLED_APPS`` admin.py modules. 
     621 
    617622In this example, we register the ``AdminSite`` instance 
    618623``myproject.admin.admin_site`` at the URL ``/myadmin/`` :: 
     
    625630        ('^myadmin/(.*)', admin_site.root), 
    626631    ) 
     632 
     633There is really no need to use autodiscover when using your own ``AdminSite`` 
     634instance since you will likely be importing all the per-app admin.py modules 
     635in your ``myproject.admin`` module. 
    627636 
    628637Note that the regular expression in the URLpattern *must* group everything in