From b223d0fd87b5580709f11c86c8eb3d5fb2142183 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 17 Oct 2005 13:05:55 +0000 Subject: [PATCH 1/4] Added note to docs/django-admin.txt about 127.0.0.1 not being accessible from other machines on the network git-svn-id: http://code.djangoproject.com/svn/django/trunk@900 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/django-admin.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/django-admin.txt b/docs/django-admin.txt index ba9bb1403f..0faabbfcca 100644 --- a/docs/django-admin.txt +++ b/docs/django-admin.txt @@ -112,6 +112,11 @@ them to standard output, but it won't stop the server. You can run as many servers as you want, as long as they're on separate ports. Just execute ``django-admin.py runserver`` more than once. +Note that the default IP address, 127.0.0.1, is not accessible from other +machines on your network. To make your development server viewable to other +machines on the network, use its own IP address (e.g. ``192.168.2.1``) or +``0.0.0.0``. + Examples: ~~~~~~~~~ From 0bb68cd0725988bd7302da293ffdb2fa9e1b2750 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 17 Oct 2005 13:20:59 +0000 Subject: [PATCH 2/4] Fixed #635 -- Fixed typo in docs/settings.txt. Thanks, anonymous git-svn-id: http://code.djangoproject.com/svn/django/trunk@902 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/settings.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.txt b/docs/settings.txt index 5a2cf46827..382a661be9 100644 --- a/docs/settings.txt +++ b/docs/settings.txt @@ -397,7 +397,7 @@ Default: ``False`` Whether to prepend the "www." subdomain to URLs that don't have it. This is only used if ``CommonMiddleware`` is installed (see the `middleware docs`_). -See also ``PREPEND_WWW``. +See also ``APPEND_SLASH``. SECRET_KEY ---------- From 383704ac844323375e743b555f6a64d6daf6d14d Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 17 Oct 2005 13:24:29 +0000 Subject: [PATCH 3/4] Fixed #634 -- Changed shortcut view to accept get_absolute_url()s that return URLs starting with http. Thanks, Hugo git-svn-id: http://code.djangoproject.com/svn/django/trunk@903 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/defaults.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/django/views/defaults.py b/django/views/defaults.py index d283e54c1b..decc220cf7 100644 --- a/django/views/defaults.py +++ b/django/views/defaults.py @@ -10,8 +10,12 @@ def shortcut(request, content_type_id, object_id): obj = content_type.get_object_for_this_type(pk=object_id) except ObjectDoesNotExist: raise Http404, "Content type %s object %s doesn't exist" % (content_type_id, object_id) - if not hasattr(obj, 'get_absolute_url'): + try: + absurl = obj.get_absolute_url() + except AttributeError: raise Http404, "%s objects don't have get_absolute_url() methods" % content_type.name + if absurl.startswith('http://'): + return httpwrappers.HttpResponseRedirect(absurl) object_domain = None if hasattr(obj, 'get_site_list'): site_list = obj.get_site_list() @@ -27,8 +31,8 @@ def shortcut(request, content_type_id, object_id): except sites.SiteDoesNotExist: pass if not object_domain: - return httpwrappers.HttpResponseRedirect(obj.get_absolute_url()) - return httpwrappers.HttpResponseRedirect('http://%s%s' % (object_domain, obj.get_absolute_url())) + return httpwrappers.HttpResponseRedirect(absurl) + return httpwrappers.HttpResponseRedirect('http://%s%s' % (object_domain, absurl)) def page_not_found(request): """ From 63a3c72e19758995c7933be0644b33ff6a5d9837 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 17 Oct 2005 14:26:20 +0000 Subject: [PATCH 4/4] Added note about multiple block tags to docs/templates.txt git-svn-id: http://code.djangoproject.com/svn/django/trunk@905 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/templates.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/templates.txt b/docs/templates.txt index 843ed0cbaa..215b663634 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -224,6 +224,13 @@ Here are some tips for working with inheritance: if you want to add to the contents of a parent block instead of completely overriding it. +Finally, note that you can't define multiple ``{% block %}`` tags with the same +name in the same template. This limitation exists because a block tag works in +"both" directions. That is, a block tag doesn't just provide a hole to fill -- +it also defines the content that fills the hole in the *parent*. If there were +two similarly-named ``{% block %}`` tags in a template, that template's parent +wouldn't know which one of the blocks' content to use. + Using the built-in reference ============================