<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -79,7 +79,7 @@ function.
     This registers your existing admin configuration with *mobileadmin*.
 
 2.  Extend the urlpatterns to hook the default ``MobileAdminSite`` instance`
-    with your favorite URL, e.g. /ma/. Add::
+    with your favorite URL, e.g. ``/ma/``. Add::
 
         urlpatterns += patterns('',
             (r'^ma/(.*)', mobileadmin.sites.site.root),
@@ -88,10 +88,21 @@ function.
     *mobileadmin* is now replicating all of the regular admin features and
     uses templates adapted to the mobile device you are using.
 
+3.  Set the ``handler404`` and ``handler500`` variables in your URLConf to the
+    views that are provided by *mobileadmin*::
+
+        handler404 = 'mobileadmin.views.page_not_found'
+        handler500 = 'mobileadmin.views.server_error'
+    
+    That is needed to load the ``404.html`` and ``500.html`` templates
+    according to the user agent of the browser on your mobile device. It
+    has an automatic fallback to `Django's default error handlers`_.
+
 .. _INSTALLED_APPS: http://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
 .. _ADMIN_MEDIA_PREFIX: http://docs.djangoproject.com/en/dev/ref/settings/#admin-media-prefix
 .. _TEMPLATE_CONTEXT_PROCESSORS: http://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
 .. _installed: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overview
+.. _Django's default error handlers: http://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views
 
 Extending ``mobileadmin``
 =========================</diff>
      <filename>docs/overview.rst</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,8 @@
 {% load i18n %}
 
 {% block title %}{% trans 'Page not found' %}{% endblock %}
+{% block breadcrumbs %}{% trans 'Page not found' %}{% endblock %}
+{% block tools %}{% endblock tools %}
 
 {% block content %}
 &lt;div class=&quot;panel&quot; selected=&quot;true&quot;&gt;</diff>
      <filename>mobileadmin/templates/mobileadmin/mobile_safari/404.html</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,8 @@
 {% load i18n %}
 
 {% block title %}{% trans 'Server error (500)' %}{% endblock %}
+{% block breadcrumbs %}{% trans 'Server error (500)' %}{% endblock %}
+{% block tools %}{% endblock tools %}
 
 {% block content %}
 &lt;div class=&quot;panel&quot; selected=&quot;true&quot;&gt;</diff>
      <filename>mobileadmin/templates/mobileadmin/mobile_safari/505.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,9 @@
 from django import template
-from django.http import HttpResponseRedirect
+from django.http import HttpResponseRedirect, HttpResponseNotFound, HttpResponseServerError
+from django.views import defaults
 from django.shortcuts import render_to_response
 from django.core.exceptions import PermissionDenied
+from django.template import Context, RequestContext, loader
 from django.utils.translation import ugettext, ugettext_lazy as _
 
 from mobileadmin import utils
@@ -49,3 +51,39 @@ def auth_add_view(self, request):
         'root_path': self.admin_site.root_path,
         'app_label': self.model._meta.app_label,
     }, context_instance=template.RequestContext(request))
+
+def page_not_found(request, template_name='404.html'):
+    &quot;&quot;&quot;
+    Mobile 404 handler.
+
+    Templates: `404.html`
+    Context:
+        request_path
+            The path of the requested URL (e.g., '/app/pages/bad_page/')
+    &quot;&quot;&quot;
+    user_agent = utils.get_user_agent(request)
+    if user_agent:
+        template_list = (
+            'mobileadmin/%s/404.html' % user_agent,
+            template_name,
+        )
+        return HttpResponseNotFound(loader.render_to_string(template_list, {
+            'request_path': request.path,
+        }, context_instance=RequestContext(request)))
+    return defaults.page_not_found(request, template_name)
+
+def server_error(request, template_name='500.html'):
+    &quot;&quot;&quot;
+    Mobile 500 error handler.
+
+    Templates: `500.html`
+    Context: None
+    &quot;&quot;&quot;
+    user_agent = utils.get_user_agent(request)
+    if user_agent:
+        template_list = (
+            'mobileadmin/%s/500.html' % user_agent,
+            template_name,
+        )
+        return HttpResponseServerError(loader.render_to_string(template_list))
+    return defaults.server_error(request, template_name)</diff>
      <filename>mobileadmin/views.py</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ from distutils.core import setup
 from distutils.command.install import INSTALL_SCHEMES
 
 app_name = &quot;mobileadmin&quot;
-version = &quot;0.5.1&quot;
+version = &quot;0.5.2&quot;
 
 # Tell distutils to put the data_files in platform-specific installation
 # locations. See here for an explanation:
@@ -32,7 +32,7 @@ for dirpath, dirnames, filenames in os.walk(app_name):
         for f in filenames:
             data_files.append(os.path.join(prefix, f))
 
-setup(name=app_name,
+setup(name='django-'+app_name,
       version=version,
       description='The Django admin interface for mobile devices.',
       long_description=open('docs/overview.rst').read(),</diff>
      <filename>setup.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e8e6ccc71e63cdd40b41812dd0789d834a7bc2f0</id>
    </parent>
  </parents>
  <author>
    <name>leidel</name>
    <email>leidel@4ed3a04f-053e-0410-b24d-b35526dee1fc</email>
  </author>
  <url>http://github.com/jezdez/django-mobileadmin/commit/9df1678583945e3442a12c59f4b940166990c8a7</url>
  <id>9df1678583945e3442a12c59f4b940166990c8a7</id>
  <committed-date>2008-09-07T17:01:42-07:00</committed-date>
  <authored-date>2008-09-07T17:01:42-07:00</authored-date>
  <message>added custom error handlers and modified the templates for mobile_safari

git-svn-id: https://django-mobileadmin.googlecode.com/svn/trunk@45 4ed3a04f-053e-0410-b24d-b35526dee1fc</message>
  <tree>27a56e149e76abadaf42a38519375fb0b128dca6</tree>
  <committer>
    <name>leidel</name>
    <email>leidel@4ed3a04f-053e-0410-b24d-b35526dee1fc</email>
  </committer>
</commit>
