That works much better Malcolm, thank you very much. Appreciate the
explanations too.

Cheers,

Peter


On Jul 22, 3:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-07-22 at 12:21 -0700, Peter Bailey wrote:
> > Hi all. I am attempting to convert an app I am writing to use the nfa.
> > I have looked at all the docs available about this, but must have
> > missed something. I am using:
>
> > Django version 1.0-alpha-SVN-8053
>
> > Anyway, I have changed my urls.py file to be like so:
>
> > from django.contrib import admin
>
> >     (r'^admin/(.*)', admin.site.root),  # in urlpatterns
>
> > and in my models file I have:
>
> > from django.contrib import admin
>
> > and then after my Page class declaration I have
>
> > admin.site.register(Page)
>
> > which creates the following error at runtime:
>
> > ImproperlyConfigured at /
> > Error while importing URLconf 'generator.urls': The model Page is
> > already registered
>
> > I have tried using the autodiscover and not using it - same result - I
> > also see some people are using an admin.py file and some are just
> > modifying the model.py file.
>
> > Can anyone point me at some info or tell me what I am doing wrong.
> > Feeling kinda stupid about now...
>
> The recommended approach (and the reason for autodiscover()) is to put
> the admin classes and registration into admin.py. Your models.py files
> are imported more than once, which is leading to the duplicate
> registration error (which is a real error in other situations, which is
> why it exists).
>
> Putting things in admin.py is a way to make sure they're only registered
> once.
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
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