On Tue, Jun 10, 2008 at 6:32 AM, Andre Meyer <[EMAIL PROTECTED]> wrote:
> hi all
>
> i was trying to write a little script to populate my database with test data
> after i have rebuilt it due to model changes. it seems to work (set the path
> and imports appropriately), but i get this infamous
> django.contrib.admin.sites.AlreadyRegistered error when running the script.
>
> is there any news on whether this error can be removed or is there a better
> way to populate the database?

It's a know problem, logged as ticket #6776. Fixing this is a blocker
on merging newforms admin, so I'd be expecting a fix sooner rather
than later.

The ticket has some patches attached; I haven't tried them myself, but
they might be worth a try.

If you want the cheap fix, you can hack the line in newforms-admin
that raises the exception. As I understand it, removing the exception
won't actually break anything - it just means that you won't be warned
if you register an application multiple times with conflicting
settings.

The other workaround is to be rigorous with your imports. The common
cause here is having references to

from myproject.myapp.models import MyModel

and

from myapp.models import MyModel

in the same body of code. This causes two separate imports, which
causes a clash on admin regsistration. If you are rigorous about only
using one form of import (I suggest the second), you can avoid a lot
of the registration problems.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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