diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-04-09 20:57:07 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-04-09 20:57:07 +0000 |
| commit | 4326de3fc1871741d9cdd4baeb81576cfb7ce398 (patch) | |
| tree | 2f48f0eb4dddcd33b15a68c2e9d931d7e72584f4 /django/core/management.py | |
| parent | a02e13c7da653c83b44ab021d06a1d3bd139ef53 (diff) | |
Fixed #3846 -- Fixed misleading variable name in 'startapp' code. Thanks, MarioGonzalez
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/management.py')
| -rw-r--r-- | django/core/management.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/django/core/management.py b/django/core/management.py index 2a45ca106b..1e4f33c2dd 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -789,11 +789,12 @@ def startapp(app_name, directory): # Determine the project_name a bit naively -- by looking at the name of # the parent directory. project_dir = os.path.normpath(os.path.join(directory, '..')) - project_name = os.path.basename(project_dir) - if app_name == os.path.basename(directory): + parent_dir = os.path.basename(project_dir) + project_name = os.path.basename(directory) + if app_name == project_name: sys.stderr.write(style.ERROR("Error: You cannot create an app with the same name (%r) as your project.\n" % app_name)) sys.exit(1) - _start_helper('app', app_name, directory, project_name) + _start_helper('app', app_name, directory, parent_dir) startapp.help_doc = "Creates a Django app directory structure for the given app name in the current directory." startapp.args = "[appname]" |
