Code

Ticket #3846: management.diff

File management.diff, 1.0 KB (added by MarioGonzalez, 7 years ago)
Line 
1Index: django/core/management.py
2===================================================================
3--- django/core/management.py   (revision 4835)
4+++ django/core/management.py   (working copy)
5@@ -809,11 +809,12 @@
6     # Determine the project_name a bit naively -- by looking at the name of
7     # the parent directory.
8     project_dir = os.path.normpath(os.path.join(directory, '..'))
9-    project_name = os.path.basename(project_dir)
10-    if app_name == os.path.basename(directory):
11+    parent_dir = os.path.basename(project_dir)
12+    project_name = os.path.basename(directory)
13+    if app_name == project_name:
14         sys.stderr.write(style.ERROR("Error: You cannot create an app with the same name (%r) as your project.\n" % app_name))
15         sys.exit(1)
16-    _start_helper('app', app_name, directory, project_name)
17+    _start_helper('app', app_name, directory, parent_dir)
18 startapp.help_doc = "Creates a Django app directory structure for the given app name in the current directory."
19 startapp.args = "[appname]"
20