summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-18 00:59:40 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-18 00:59:40 +0000
commit324eba99cbfb257de7e2cb377f550a31a84fa673 (patch)
tree44f7e36cb8b6ae1b4aef583df2b81b1399cb11a0
parent7bc0878922d9d93ab8f4ef8a5c5ba7a1c671279f (diff)
Fixed #10526 -- More fixes when specifying installed apps using "foo.*".
This adds a case that was missed in r9924: underscore handling. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10078 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/conf/__init__.py4
-rw-r--r--tests/regressiontests/app_loading/parent/__init__.py1
-rw-r--r--tests/regressiontests/app_loading/parent/app/__init__.py1
-rw-r--r--tests/regressiontests/app_loading/parent/app1/__init__.py1
-rw-r--r--tests/regressiontests/app_loading/parent/app_2/__init__.py0
-rw-r--r--tests/regressiontests/app_loading/tests.py2
6 files changed, 4 insertions, 5 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 785302c6fd..c980ee0b28 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -7,6 +7,7 @@ a list of all possible variables.
"""
import os
+import re
import time # Needed for Windows
from django.conf import global_settings
@@ -91,8 +92,9 @@ class Settings(object):
appdir = os.path.dirname(__import__(app[:-2], {}, {}, ['']).__file__)
app_subdirs = os.listdir(appdir)
app_subdirs.sort()
+ name_pattern = re.compile(r'[a-zA-Z]\w*')
for d in app_subdirs:
- if d.isalnum() and d[0].isalpha() and os.path.isdir(os.path.join(appdir, d)):
+ if name_pattern.match(d) and os.path.isdir(os.path.join(appdir, d)):
new_installed_apps.append('%s.%s' % (app[:-2], d))
else:
new_installed_apps.append(app)
diff --git a/tests/regressiontests/app_loading/parent/__init__.py b/tests/regressiontests/app_loading/parent/__init__.py
index 51c842b5ba..e69de29bb2 100644
--- a/tests/regressiontests/app_loading/parent/__init__.py
+++ b/tests/regressiontests/app_loading/parent/__init__.py
@@ -1 +0,0 @@
-# not empty to make SVN happy
diff --git a/tests/regressiontests/app_loading/parent/app/__init__.py b/tests/regressiontests/app_loading/parent/app/__init__.py
index 51c842b5ba..e69de29bb2 100644
--- a/tests/regressiontests/app_loading/parent/app/__init__.py
+++ b/tests/regressiontests/app_loading/parent/app/__init__.py
@@ -1 +0,0 @@
-# not empty to make SVN happy
diff --git a/tests/regressiontests/app_loading/parent/app1/__init__.py b/tests/regressiontests/app_loading/parent/app1/__init__.py
index 51c842b5ba..e69de29bb2 100644
--- a/tests/regressiontests/app_loading/parent/app1/__init__.py
+++ b/tests/regressiontests/app_loading/parent/app1/__init__.py
@@ -1 +0,0 @@
-# not empty to make SVN happy
diff --git a/tests/regressiontests/app_loading/parent/app_2/__init__.py b/tests/regressiontests/app_loading/parent/app_2/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/app_loading/parent/app_2/__init__.py
diff --git a/tests/regressiontests/app_loading/tests.py b/tests/regressiontests/app_loading/tests.py
index 444de10d79..bc958c0d88 100644
--- a/tests/regressiontests/app_loading/tests.py
+++ b/tests/regressiontests/app_loading/tests.py
@@ -14,7 +14,7 @@ Test the globbing of INSTALLED_APPS.
>>> settings = Settings('test_settings')
>>> settings.INSTALLED_APPS
-['parent.app', 'parent.app1']
+['parent.app', 'parent.app1', 'parent.app_2']
>>> sys.path = old_sys_path