Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #9323 -- Allow glob loading in INSTALLED_APPS to handle digits …

…in names.

Patch from carljm.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 242fc605209375425f25cdf591089d7804835606 1 parent d8fdf4d
Malcolm Tredinnick authored March 08, 2009
2  django/conf/__init__.py
@@ -92,7 +92,7 @@ def __init__(self, settings_module):
92 92
                 app_subdirs = os.listdir(appdir)
93 93
                 app_subdirs.sort()
94 94
                 for d in app_subdirs:
95  
-                    if d.isalpha() and os.path.isdir(os.path.join(appdir, d)):
  95
+                    if d.isalnum() and d[0].isalpha() and os.path.isdir(os.path.join(appdir, d)):
96 96
                         new_installed_apps.append('%s.%s' % (app[:-2], d))
97 97
             else:
98 98
                 new_installed_apps.append(app)
0  tests/regressiontests/app_loading/__init__.py
No changes.
0  tests/regressiontests/app_loading/models.py
No changes.
1  tests/regressiontests/app_loading/parent/__init__.py
... ...
@@ -0,0 +1 @@
  1
+# not empty to make SVN happy
1  tests/regressiontests/app_loading/parent/app/__init__.py
... ...
@@ -0,0 +1 @@
  1
+# not empty to make SVN happy
1  tests/regressiontests/app_loading/parent/app1/__init__.py
... ...
@@ -0,0 +1 @@
  1
+# not empty to make SVN happy
3  tests/regressiontests/app_loading/test_settings.py
... ...
@@ -0,0 +1,3 @@
  1
+INSTALLED_APPS = (
  2
+    'parent.*',
  3
+)
18  tests/regressiontests/app_loading/tests.py
... ...
@@ -0,0 +1,18 @@
  1
+"""
  2
+Test the globbing of INSTALLED_APPS.
  3
+
  4
+>>> import os, sys
  5
+>>> old_sys_path = sys.path
  6
+>>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))
  7
+
  8
+>>> from django.conf import Settings
  9
+
  10
+>>> s = Settings('test_settings')
  11
+
  12
+>>> s.INSTALLED_APPS
  13
+['parent.app', 'parent.app1']
  14
+
  15
+>>> sys.path = old_sys_path
  16
+
  17
+"""
  18
+

0 notes on commit 242fc60

Please sign in to comment.
Something went wrong with that request. Please try again.