diff --git a/django/core/management/commands/startapp.py b/django/core/management/commands/startapp.py
index 13d6483..7612520 100644
a
|
b
|
import os
|
3 | 3 | from django.core.management.base import copy_helper, CommandError, LabelCommand |
4 | 4 | from django.utils.importlib import import_module |
5 | 5 | |
| 6 | # to check if upper level directory is really a django project |
| 7 | std_project_files = ("manage.py","urls.py") |
| 8 | |
6 | 9 | class Command(LabelCommand): |
7 | 10 | help = "Creates a Django app directory structure for the given app name in the current directory." |
8 | 11 | args = "[appname]" |
… |
… |
class Command(LabelCommand):
|
21 | 24 | # which should be the full path of the project directory (or the |
22 | 25 | # current directory if no directory was passed). |
23 | 26 | project_name = os.path.basename(directory) |
| 27 | |
24 | 28 | if app_name == project_name: |
25 | | raise CommandError("You cannot create an app with the same name" |
| 29 | for filename in std_project_files: |
| 30 | if not os.path.isfile(os.path.join(project_name,filename)): |
| 31 | break |
| 32 | else: |
| 33 | raise CommandError("You cannot create an app with the same name" |
26 | 34 | " (%r) as your project." % app_name) |
27 | 35 | |
28 | 36 | # Check that the app_name cannot be imported. |