Ticket #9092: 9092.diff
File 9092.diff, 903 bytes (added by , 16 years ago) |
---|
-
django/core/management/base.py
194 194 import re 195 195 import shutil 196 196 other = {'project': 'app', 'app': 'project'}[app_or_project] 197 if not re.search(r'^ \w+$', name): # If it's not a valid directory name.198 raise CommandError("%r is not a valid %s name. Please use only numbers, letters and underscores. " % (name, app_or_project))197 if not re.search(r'^[_a-zA-Z][_a-zA-Z0-9]*$', name): # If it's not a valid directory name. 198 raise CommandError("%r is not a valid %s name. Please use only numbers, letters and underscores. The first character must be a letter or an underscore." % (name, app_or_project)) 199 199 top_dir = os.path.join(directory, name) 200 200 try: 201 201 os.mkdir(top_dir)