From 324eba99cbfb257de7e2cb377f550a31a84fa673 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 18 Mar 2009 00:59:40 +0000 Subject: 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 --- django/conf/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'django') 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) -- cgit v1.3