Skip to content

Commit

Permalink
Fixed #9323 -- Allow glob loading in INSTALLED_APPS to handle digits …
Browse files Browse the repository at this point in the history
…in names.

Patch from carljm.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Mar 8, 2009
1 parent d8fdf4d commit 242fc60
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion django/conf/__init__.py
Expand Up @@ -92,7 +92,7 @@ def __init__(self, settings_module):
app_subdirs = os.listdir(appdir)
app_subdirs.sort()
for d in app_subdirs:
if d.isalpha() and os.path.isdir(os.path.join(appdir, d)):
if d.isalnum() and d[0].isalpha() and os.path.isdir(os.path.join(appdir, d)):
new_installed_apps.append('%s.%s' % (app[:-2], d))
else:
new_installed_apps.append(app)
Expand Down
Empty file.
Empty file.
1 change: 1 addition & 0 deletions tests/regressiontests/app_loading/parent/__init__.py
@@ -0,0 +1 @@
# not empty to make SVN happy
1 change: 1 addition & 0 deletions tests/regressiontests/app_loading/parent/app/__init__.py
@@ -0,0 +1 @@
# not empty to make SVN happy
1 change: 1 addition & 0 deletions tests/regressiontests/app_loading/parent/app1/__init__.py
@@ -0,0 +1 @@
# not empty to make SVN happy
3 changes: 3 additions & 0 deletions tests/regressiontests/app_loading/test_settings.py
@@ -0,0 +1,3 @@
INSTALLED_APPS = (
'parent.*',
)
18 changes: 18 additions & 0 deletions tests/regressiontests/app_loading/tests.py
@@ -0,0 +1,18 @@
"""
Test the globbing of INSTALLED_APPS.
>>> import os, sys
>>> old_sys_path = sys.path
>>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))
>>> from django.conf import Settings
>>> s = Settings('test_settings')
>>> s.INSTALLED_APPS
['parent.app', 'parent.app1']
>>> sys.path = old_sys_path
"""

0 comments on commit 242fc60

Please sign in to comment.