On 02/13/2012 06:51 AM, xina towner wrote:
> Hi, I get this message when I try to acces to the admin page:
>
> AlreadyRegistered at /admin
>
>
> The model Location is already registered
>
>
> does anybody know which is the problem?
>
This is a horrible, horrible problem which I've worked around as follows:
from django.contrib.admin import site
def adminRegister(model, admin_class=None, **kwargs):
'''(Re)register a model with the AdminSite site.'''
if model in site._registry:
site.unregister(model)
site.register(model, admin_class, **kwargs)
class MagicModel(models.Model):
pass
adminRegister(MagicModel)
I encountered this whenever I tried to run ./manage.py shell and
./manage.py runserver at the same time. If I understood what I read in
the development list, though, this is being fixed for release 1.4.
--
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.