Re: [Django] #5617: Default server_error view should render with RequestContext

2012-04-02 Thread Django
#5617: Default server_error view should render with RequestContext
-+-
 Reporter:  Nick Fishman |Owner:  nobody
    |   Status:  closed
 Type:  New feature  |  Version:  SVN
Component:  ORM aggregation  |   Resolution:  wontfix
 Severity:  Release blocker  | Triage Stage:  Accepted
 Keywords:  server_error,|  Needs documentation:  0
  RequestContext, error, templates   |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by anonymous):

 * type:  Uncategorized => New feature
 * component:  HTTP handling => ORM aggregation
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Replying to [ticket:5617 Nick Fishman ]:
 > Currently, the default server_error view in django.views.defaults
 renders using the following code:
 > {{{
 > return http.HttpResponseServerError(t.render(Context({})))
 > }}}
 >
 > However, this prevents the context processors specified in
 SETTINGS.TEMPLATE_CONTEXT_PROCESSORS from being loaded. For example, if a
 base.html might include branding that includes the current date and time
 (which is passed in through a custom context processor). Currently, if we
 try to extend base.html in the 500.html template, we get an error because
 the context variable for the date and time isn't loaded.
 >
 > The best solution seems to be similar to the way the page_not_found view
 renders:
 > {{{
 > return http.HttpResponseServerError(t.render(RequestContext(request)))
 > }}}
 >
 > Although the page_not_found view also passes in a request_path variable
 to RequestContext, I'm not sure if this is necessary.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #5617: Default server_error view should render with RequestContext

2011-09-21 Thread Django
#5617: Default server_error view should render with RequestContext
-+-
   Reporter:  Nick   |  Owner:  nobody
  Fishman   | Status:  closed
   Type: |  Component:  HTTP handling
  Uncategorized  |   Severity:  Normal
  Milestone: |   Keywords:  server_error,
Version:  SVN|  RequestContext, error, templates
 Resolution:  wontfix|  Has patch:  1
   Triage Stage: |Needs tests:  0
  Unreviewed |  Easy pickings:  0
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by tomchristie):

 * ui_ux:   => 0
 * type:   => Uncategorized
 * severity:   => Normal
 * easy:   => 0


Comment:

 See also this discussion - https://groups.google.com/d/topic/django-
 developers/UH8ehYL8Pss/discussion

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #5617: Default server_error view should render with RequestContext

2009-12-18 Thread Django
#5617: Default server_error view should render with RequestContext
-+--
  Reporter:  Nick Fishman   | Owner:  
nobody
Status:  closed  | Milestone:   
 
 Component:  HTTP handling   |   Version:  
SVN   
Resolution:  wontfix |  Keywords:  
server_error, RequestContext, error, templates
 Stage:  Unreviewed  | Has_patch:  
1 
Needs_docs:  0   |   Needs_tests:  
0 
Needs_better_patch:  0   |  
-+--
Changes (by Alex):

  * status:  reopened => closed
  * resolution:  => wontfix

Comment:

 This ticket was closed by a core developer, if you want to reopen the
 discussion about this please do it on the django-developers mailing list.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




Re: [Django] #5617: Default server_error view should render with RequestContext

2009-12-18 Thread Django
#5617: Default server_error view should render with RequestContext
-+--
  Reporter:  Nick Fishman   | Owner:  
nobody
Status:  reopened| Milestone:   
 
 Component:  HTTP handling   |   Version:  
SVN   
Resolution:  |  Keywords:  
server_error, RequestContext, error, templates
 Stage:  Unreviewed  | Has_patch:  
1 
Needs_docs:  0   |   Needs_tests:  
0 
Needs_better_patch:  0   |  
-+--
Changes (by IonelMaries):

 * cc: ionel...@gmail.com (added)
  * status:  closed => reopened
  * resolution:  wontfix =>

Comment:

 I'm seconding this too. I know this is a django design choice but it's
 very inflexible - please review again.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




Re: [Django] #5617: Default server_error view should render with RequestContext

2009-04-07 Thread Django
#5617: Default server_error view should render with RequestContext
-+--
  Reporter:  Nick Fishman   | Owner:  
nobody
Status:  closed  | Milestone:   
 
 Component:  HTTP handling   |   Version:  
SVN   
Resolution:  wontfix |  Keywords:  
server_error, RequestContext, error, templates
 Stage:  Unreviewed  | Has_patch:  
1 
Needs_docs:  0   |   Needs_tests:  
0 
Needs_better_patch:  0   |  
-+--
Comment (by stavros):

 I would like to second this. I find tobias's approach best, as it doesn't
 break the handler on error and still allows people to use the
 RequestContext. I think that every site that uses MEDIA_URL will have a
 hacky handler500 to pass this to the template, and I think it would be
 much better if this was default Django bejaviour.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #5617: Default server_error view should render with RequestContext

2008-09-26 Thread Django
#5617: Default server_error view should render with RequestContext
-+--
  Reporter:  Nick Fishman <[EMAIL PROTECTED]>  | Owner:  nobody 
   
Status:  closed  | Milestone:   
 
 Component:  HTTP handling   |   Version:  
SVN   
Resolution:  wontfix |  Keywords:  
server_error, RequestContext, error, templates
 Stage:  Unreviewed  | Has_patch:  
1 
Needs_docs:  0   |   Needs_tests:  
0 
Needs_better_patch:  0   |  
-+--
Comment (by tobias):

 what about something like this?

 {{{
 def render_safe(request, template_name):
 t = loader.get_template(template_name)
 try:
 context = RequestContext(request, {'request_path':
 request.path})
 return t.render(context)
 except:
 return t.render(Context({}))


 def page_not_found(request, template_name='404.html'):
 """
 Default 404 handler.

 Templates: `404.html`
 Context:
 request_path
 The path of the requested URL (e.g.,
 '/app/pages/bad_page/')
 """
 return http.HttpResponseNotFound(render_safe(request,
 template_name))


 def server_error(request, template_name='500.html'):
 """
 500 error handler.

 Templates: `500.html`
 Context: None
 """
 return http.HttpResponseServerError(render_safe(request,
 template_name))
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@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-updates?hl=en
-~--~~~~--~~--~--~---