From 3e7ea41bbb30499701a86ddfad0331333e7d89ee Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 20 Oct 2005 21:58:01 +0000 Subject: [PATCH 1/3] Added note about ALLOWED_INCLUDE_ROOTS to docs/templates.txt git-svn-id: http://code.djangoproject.com/svn/django/trunk@983 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/templates.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/templates.txt b/docs/templates.txt index e543b59763..87cb296328 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -610,6 +610,11 @@ Built-in tag reference {% ssi /home/html/ljworld.com/includes/right_generic.html parsed %} + Note that if you use ``{% ssi %}``, you'll need to define + `ALLOWED_INCLUDE_ROOTS`_ in your Django settings, as a security measure. + +.. _ALLOWED_INCLUDE_ROOTS: http://www.djangoproject.com/documentation/settings/#allowed-include-roots + ``templatetag`` Output one of the bits used to compose template tags. From 81cbf27a13725f202743f02f2776d5613e2bf221 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 20 Oct 2005 22:58:33 +0000 Subject: [PATCH 2/3] Fixed #668 -- Changed default site from mysite.com to example.com. Thanks, Ian git-svn-id: http://code.djangoproject.com/svn/django/trunk@984 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/management.py b/django/core/management.py index 564697776d..3b973c28da 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -299,7 +299,7 @@ def init(): cursor = db.db.cursor() for sql in get_sql_create(core) + get_sql_create(auth) + get_sql_initial_data(core) + get_sql_initial_data(auth): cursor.execute(sql) - cursor.execute("INSERT INTO %s (domain, name) VALUES ('mysite.com', 'My Django site')" % core.Site._meta.db_table) + cursor.execute("INSERT INTO %s (domain, name) VALUES ('example.com', 'Example site')" % core.Site._meta.db_table) except Exception, e: sys.stderr.write("Error: The database couldn't be initialized.\n%s\n" % e) try: From cc3635d62fa414ea7e4a263f0ae8e141b62fa8b6 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 20 Oct 2005 23:16:45 +0000 Subject: [PATCH 3/3] Fixed #663 -- app_directories template loader no longer assumes a dot in the app name. Thanks, Sune git-svn-id: http://code.djangoproject.com/svn/django/trunk@985 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/template/loaders/app_directories.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/django/core/template/loaders/app_directories.py b/django/core/template/loaders/app_directories.py index 5afb18e2f5..b8bd0d6169 100644 --- a/django/core/template/loaders/app_directories.py +++ b/django/core/template/loaders/app_directories.py @@ -1,6 +1,7 @@ # Wrapper for loading templates from "template" directories in installed app packages. from django.conf.settings import INSTALLED_APPS, TEMPLATE_FILE_EXTENSION +from django.core.exceptions import ImproperlyConfigured from django.core.template import TemplateDoesNotExist import os @@ -8,8 +9,17 @@ import os app_template_dirs = [] for app in INSTALLED_APPS: i = app.rfind('.') - m, a = app[:i], app[i+1:] - mod = getattr(__import__(m, '', '', [a]), a) + if i == -1: + m, a = app, None + else: + m, a = app[:i], app[i+1:] + try: + if a is None: + mod = __import__(m, '', '', []) + else: + mod = getattr(__import__(m, '', '', [a]), a) + except ImportError, e: + raise ImproperlyConfigured, 'ImportError %s: %s' % (app, e.args[0]) template_dir = os.path.join(os.path.dirname(mod.__file__), 'templates') if os.path.isdir(template_dir): app_template_dirs.append(template_dir)