Ticket #3846: management.diff

File management.diff, 1.0 KB (added by MarioGonzalez, 18 years ago)
  • django/core/management.py

     
    809809    # Determine the project_name a bit naively -- by looking at the name of
    810810    # the parent directory.
    811811    project_dir = os.path.normpath(os.path.join(directory, '..'))
    812     project_name = os.path.basename(project_dir)
    813     if app_name == os.path.basename(directory):
     812    parent_dir = os.path.basename(project_dir)
     813    project_name = os.path.basename(directory)
     814    if app_name == project_name:
    814815        sys.stderr.write(style.ERROR("Error: You cannot create an app with the same name (%r) as your project.\n" % app_name))
    815816        sys.exit(1)
    816     _start_helper('app', app_name, directory, project_name)
     817    _start_helper('app', app_name, directory, parent_dir)
    817818startapp.help_doc = "Creates a Django app directory structure for the given app name in the current directory."
    818819startapp.args = "[appname]"
    819820
Back to Top