Am Freitag, 27. März 2009 14:28:28 schrieb Karen Tracey:
> On Fri, Mar 27, 2009 at 9:19 AM, Stephan John <em...@stephanjohn.de> wrote:
> > I registered the models with:
> > admin.site.register(Beitrag, BeitragAdmin)
> > admin.site.register(Container, ContainerAdmin)
> >
> > It works fine in debug-mode. I have problems only if debug is false.
>
> And those lines are actually executed when DEBUG is False?  What I'm saying
> is that the urlpatterns displayed when it is not working look like no calls
> to register have been made.  I don't see anything in the admin code itself
> that is dependent on the DEBUG setting that would explain that, nor can I
> recreate the problem if I set DEBUG to False in my own app, so my first
> guess is that your code somehow doesn't actually execute those register
> lines when DEBUG is False.
>
> Karen
>
> 
Yes, both lines are in the file models.py as the last lines.

I've added the following lines in the file ../django/contrib/admin/sites.py 
after line 87:
f = open('/tmp/error.tmp', 'w+')
f.write(str(admin_class))
f.write(str(model))
f.close()

The Output in the tmp-file is:
<class 'project.mainpage.models.ContainerAdmin'><class 
'project.mainpage.models.Container'>

For me it looks ok – the model is registered.



--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to