Re: Admin 500 Error

2008-09-09 Thread Bret W



On Sep 8, 9:43 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:

> I am aware of one problem reported with the admin home page and debug set to
> False.  It is:
>
> http://code.djangoproject.com/ticket/8110

That was it. Thanks!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Admin 500 Error

2008-09-08 Thread Karen Tracey
On Mon, Sep 8, 2008 at 9:31 PM, Bret W <[EMAIL PROTECTED]> wrote:

>
> When DEBUG = True, the admin loads just fine.
>
> My problem is that I can't get the admin to fail when debugging is
> turned on, so I can never see the helpful Django debugging page.
>
> Further, I don't believe any objects are passed to the 500 template,
> so I can't display errors using my template. That's why I removed my
> 500.html template -- so that mod_python would throw the (nasty
> looking) error.
>
> I'm trying to figure out a) why the admin is throwing errors only when
> DEBUG=False and b) how I can display the source of the error.
>
>
To get the traceback mailed to you, include your userid in the ADMINS list
in settings.py and set the various EMAIL_ settings to specify a valid mail
server and source email id (see
http://docs.djangoproject.com/en/dev/ref/settings/#email-host).

I am aware of one problem reported with the admin home page and debug set to
False.  It is:

http://code.djangoproject.com/ticket/8110

It's a shot in the dark, but you could try applying the 8110.diff posted on
that ticket and seeing if it fixes the problem.  I have not been able to
recreate this problem myself.

Karen

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Admin 500 Error

2008-09-08 Thread Bret W

Sorry to post yet again.

Two things I forgot to mention -- this error only happens on the admin
home page and all of my INSTALLED_APPS should be valid and seem to be
functioning correctly.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Admin 500 Error

2008-09-08 Thread Bret W

On Sep 8, 8:57 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Because that's when Django is not going to use the debugging page, but
> rather display your 500 template. When DEBUG=True, you will see the nice
> debugging page, but that's for development purposes, not for general
> production use (although it can be useful to have it on for brief
> periods in production to diagnose problems).

I probably wasn't very clear.

When DEBUG = True, the admin loads just fine.

My problem is that I can't get the admin to fail when debugging is
turned on, so I can never see the helpful Django debugging page.

Further, I don't believe any objects are passed to the 500 template,
so I can't display errors using my template. That's why I removed my
500.html template -- so that mod_python would throw the (nasty
looking) error.

I'm trying to figure out a) why the admin is throwing errors only when
DEBUG=False and b) how I can display the source of the error.

Thanks,
Bret
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Admin 500 Error

2008-09-08 Thread Malcolm Tredinnick


On Mon, 2008-09-08 at 16:59 -0700, Bret W wrote:
> I can only get this error to show up if DEBUG is set to False, 

Because that's when Django is not going to use the debugging page, but
rather display your 500 template. When DEBUG=True, you will see the nice
debugging page, but that's for development purposes, not for general
production use (although it can be useful to have it on for brief
periods in production to diagnose problems).

> but it
> happens consistently when debugging is off.

Which means that your site is consistently throwing some kind of
internal error.

> 
> MOD_PYTHON ERROR
> 
> ProcessId:  10229
> Interpreter:'webfaction.com'
> 
> ServerName: 'webfaction.com'
> DocumentRoot:   '/home/user/webapps/mysite/django_static'
> 
> URI:'/admin/'
> Location:   '/'
> Directory:  None
> Filename:   '/home/user/webapps/mysite/django_static/admin'
> PathInfo:   '/'
> 
> Phase:  'PythonHandler'
> Handler:'django.core.handlers.modpython'
> 
> Traceback (most recent call last):
> 
>   File "/home/user/lib/python2.5/mod_python/importer.py", line 1537,
> in HandlerDispatch
> default=default_handler, arg=req, silent=hlist.silent)
> 
>   File "/home/user/lib/python2.5/mod_python/importer.py", line 1229,
> in _process_target
> result = _execute_target(config, req, object, arg)
> 
>   File "/home/user/lib/python2.5/mod_python/importer.py", line 1128,
> in _execute_target
> result = object(arg)
> 
>   File "/home/user/lib/python2.5/django/core/handlers/modpython.py",
> line 222, in handler
> return ModPythonHandler()(req)
> 
>   File "/home/user/lib/python2.5/django/core/handlers/modpython.py",
> line 195, in __call__
> response = self.get_response(request)
> 
>   File "/home/user/lib/python2.5/django/core/handlers/base.py", line
> 128, in get_response
> return self.handle_uncaught_exception(request, resolver, exc_info)
> 
>   File "/home/user/lib/python2.5/django/core/handlers/base.py", line
> 160, in handle_uncaught_exception
> return callback(request, **param_dict)
> 
>   File "/home/user/lib/python2.5/django/views/defaults.py", line 88,
> in server_error
> t = loader.get_template(template_name) # You need to create a
> 500.html template.
> 
>   File "/home/user/webapps/mysite/django_projects/bretwcom/
> __init__.py", line 11, in cached_get_template
> template_cache[template_name] = t =
> original_get_template(template_name)
> 
>   File "/home/user/webapps/mysite/django_projects/bretwcom/
> __init__.py", line 11, in cached_get_template
> template_cache[template_name] = t =
> original_get_template(template_name)
> 
>   File "/home/user/lib/python2.5/django/template/loader.py", line 80,
> in get_template
> source, origin = find_template_source(template_name)
> 
>   File "/home/user/lib/python2.5/django/template/loader.py", line 73,
> in find_template_source
> raise TemplateDoesNotExist, name
> 
> TemplateDoesNotExist: 500.html

You are responsible for providing a 500.html template that will be
returned to your users when an internal, uncaught error is thrown. That
still won't provide you with any extra debugging information, unless you
enable mailing to the admins (which will then send 500 errors to you).
You could set DEBUG=True for a while if you can trigger the problem
yourself and then use the debug screen to diagnose the problem, but if
it is only occurring sporadically, that won't be as productive.

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
-~--~~~~--~~--~--~---