Ticket #3299: management.diff

File management.diff, 1.1 KB (added by ubernostrum, 9 years ago)

Patch which adds 'test' to INVALID_PROJECT_NAMES and improves the error message

  • django/core/management.py

     
    2525# which has been installed.
    2626PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', '%s_template')
    2727
    28 INVALID_PROJECT_NAMES = ('django', 'test')
     28INVALID_PROJECT_NAMES = ('django', 'site', 'test')
    2929
    3030# Set up the terminal color scheme.
    3131class dummy: pass
     
    708708    "Creates a Django project for the given project_name in the given directory."
    709709    from random import choice
    710710    if project_name in INVALID_PROJECT_NAMES:
    711         sys.stderr.write(style.ERROR("Error: %r isn't a valid project name. Please try another.\n" % project_name))
     711        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))
    712712        sys.exit(1)
    713713    _start_helper('project', project_name, directory)
    714714    # Create a random SECRET_KEY hash, and put it in the main settings.
Back to Top