Author: gwilson
Date: 2007-10-27 11:05:59 -0500 (Sat, 27 Oct 2007)
New Revision: 6621
Modified:
django/trunk/django/core/management/commands/startapp.py
Log:
Fixed #5824 -- For the `startapp` command, pass the true project name to the
`copy_helper` function instead of the name of the project's parent directory.
Modified: django/trunk/django/core/management/commands/startapp.py
===================================================================
--- django/trunk/django/core/management/commands/startapp.py 2007-10-27
16:03:24 UTC (rev 6620)
+++ django/trunk/django/core/management/commands/startapp.py 2007-10-27
16:05:59 UTC (rev 6621)
@@ -14,14 +14,13 @@
def handle_label(self, app_name, directory=None, **options):
if directory is None:
directory = os.getcwd()
- # 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, os.pardir))
- parent_dir = os.path.basename(project_dir)
+ # Determine the project_name by using the basename of directory,
+ # which should be the full path of the project directory (or the
+ # current directory if no directory was passed).
project_name = os.path.basename(directory)
if app_name == project_name:
raise CommandError("You cannot create an app with the same name
(%r) as your project." % app_name)
- copy_helper(self.style, 'app', app_name, directory, parent_dir)
+ copy_helper(self.style, 'app', app_name, directory, project_name)
class ProjectCommand(Command):
help = "Creates a Django app directory structure for the given app name in
this project's directory."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---