Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 324eba99cbfb257de7e2cb377f550a31a84fa673 1 parent 7bc0878
Malcolm Tredinnick authored March 18, 2009
4  django/conf/__init__.py
@@ -7,6 +7,7 @@
7 7
 """
8 8
 
9 9
 import os
  10
+import re
10 11
 import time     # Needed for Windows
11 12
 
12 13
 from django.conf import global_settings
@@ -91,8 +92,9 @@ def __init__(self, settings_module):
91 92
                 appdir = os.path.dirname(__import__(app[:-2], {}, {}, ['']).__file__)
92 93
                 app_subdirs = os.listdir(appdir)
93 94
                 app_subdirs.sort()
  95
+                name_pattern = re.compile(r'[a-zA-Z]\w*')
94 96
                 for d in app_subdirs:
95  
-                    if d.isalnum() and d[0].isalpha() and os.path.isdir(os.path.join(appdir, d)):
  97
+                    if name_pattern.match(d) and os.path.isdir(os.path.join(appdir, d)):
96 98
                         new_installed_apps.append('%s.%s' % (app[:-2], d))
97 99
             else:
98 100
                 new_installed_apps.append(app)
1  tests/regressiontests/app_loading/parent/__init__.py
... ...
@@ -1 +0,0 @@
1  
-# not empty to make SVN happy
1  tests/regressiontests/app_loading/parent/app/__init__.py
... ...
@@ -1 +0,0 @@
1  
-# not empty to make SVN happy
1  tests/regressiontests/app_loading/parent/app1/__init__.py
... ...
@@ -1 +0,0 @@
1  
-# not empty to make SVN happy
0  tests/regressiontests/app_loading/parent/app_2/__init__.py
No changes.
2  tests/regressiontests/app_loading/tests.py
@@ -14,7 +14,7 @@
14 14
 >>> settings = Settings('test_settings')
15 15
 
16 16
 >>> settings.INSTALLED_APPS
17  
-['parent.app', 'parent.app1']
  17
+['parent.app', 'parent.app1', 'parent.app_2']
18 18
 
19 19
 >>> sys.path = old_sys_path
20 20
 

0 notes on commit 324eba9

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