Fixed #3299 -- Added 'site' to the list of INVALID_PROJECT_NAMES and improved the error message. Thanks for the patch, ubernostrum
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4424 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9d94355885
commit
de60cf04d0
|
@ -25,7 +25,7 @@ APP_ARGS = '[appname ...]'
|
||||||
# which has been installed.
|
# which has been installed.
|
||||||
PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', '%s_template')
|
PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', '%s_template')
|
||||||
|
|
||||||
INVALID_PROJECT_NAMES = ('django', 'test')
|
INVALID_PROJECT_NAMES = ('django', 'site', 'test')
|
||||||
|
|
||||||
# Set up the terminal color scheme.
|
# Set up the terminal color scheme.
|
||||||
class dummy: pass
|
class dummy: pass
|
||||||
|
@ -708,7 +708,7 @@ def startproject(project_name, directory):
|
||||||
"Creates a Django project for the given project_name in the given directory."
|
"Creates a Django project for the given project_name in the given directory."
|
||||||
from random import choice
|
from random import choice
|
||||||
if project_name in INVALID_PROJECT_NAMES:
|
if project_name in INVALID_PROJECT_NAMES:
|
||||||
sys.stderr.write(style.ERROR("Error: %r isn't a valid project name. Please try another.\n" % project_name))
|
sys.stderr.write(style.ERROR("Error: '%r' conflicts with the name of an existing Python module and cannot be used as a project name. Please try another name.\n" % project_name))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
_start_helper('project', project_name, directory)
|
_start_helper('project', project_name, directory)
|
||||||
# Create a random SECRET_KEY hash, and put it in the main settings.
|
# Create a random SECRET_KEY hash, and put it in the main settings.
|
||||||
|
|
Loading…
Reference in New Issue