Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@malcolmt malcolmt authored
View
4 django/conf/__init__.py
@@ -7,6 +7,7 @@
"""
import os
+import re
import time # Needed for Windows
from django.conf import global_settings
@@ -91,8 +92,9 @@ def __init__(self, settings_module):
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)
View
1  tests/regressiontests/app_loading/parent/__init__.py
@@ -1 +0,0 @@
-# not empty to make SVN happy
View
1  tests/regressiontests/app_loading/parent/app/__init__.py
@@ -1 +0,0 @@
-# not empty to make SVN happy
View
1  tests/regressiontests/app_loading/parent/app1/__init__.py
@@ -1 +0,0 @@
-# not empty to make SVN happy
View
0  tests/regressiontests/app_loading/parent/app_2/__init__.py
No changes.
View
2  tests/regressiontests/app_loading/tests.py
@@ -14,7 +14,7 @@
>>> settings = Settings('test_settings')
>>> settings.INSTALLED_APPS
-['parent.app', 'parent.app1']
+['parent.app', 'parent.app1', 'parent.app_2']
>>> sys.path = old_sys_path
Please sign in to comment.
Something went wrong with that request. Please try again.