Opened 17 years ago

Closed 17 years ago

#3299 closed defect (fixed)

[patch] the name of project cannot have the name "site"

Reported by: anonymous Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords: site INVALID_PROJECT_NAMES
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

hi all,

$django-admin.py startproject site
$cd site
$python manage.py runserver

and he say he is in a bad moon

Traceback (most recent call last):
  File "manage.py", line 11, in ?
    execute_manager(settings)
  File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/management.py", line 1319, in execute_manager
    execute_from_command_line(action_mapping, argv)
  File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/management.py", line 1237, in execute_from_command_line
    from django.utils import translation
  File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/utils/translation/__init__.py", line 3, in ?
    if settings.USE_I18N:
  File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/conf/__init__.py", line 27, in __getattr__
    self._import_settings()
  File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/conf/__init__.py", line 54, in _import_settings
    self._target = Settings(settings_module)
  File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/conf/__init__.py", line 82, in __init__
    raise EnvironmentError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
EnvironmentError: Could not import settings 'site.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings

to bypass that just not name your project "site", but I thing when you start with you have that error, you spend lots of time to find what's going wrong,
a simple message with " site bad name change name" is not a lot.

Attachments (1)

management.diff (1.1 KB ) - added by James Bennett 17 years ago.
Patch which adds 'test' to INVALID_PROJECT_NAMES and improves the error message

Download all attachments as: .zip

Change History (5)

comment:1 by James Bennett, 17 years ago

This should actually be added to INVALID_PROJECT_NAMES in django.core.management; site is a core module of the Python language and we shouldn't allow projects to be given names which conflict with it (we already don't permit a couple of names which would cause conflicts).

by James Bennett, 17 years ago

Attachment: management.diff added

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

comment:2 by James Bennett, 17 years ago

Summary: the name of project cannot have the name "site"[patch] the name of project cannot have the name "site"

Added a patch which inserts 'site' into INVALID_PROJECT_NAMES and improves the error message by pointing out that the problem is a conflict with the name of an existing module.

comment:3 by Simon G. <dev@…>, 17 years ago

Keywords: site INVALID_PROJECT_NAMES added
Triage Stage: UnreviewedReady for checkin

comment:4 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

(In [4424]) Fixed #3299 -- Added 'site' to the list of INVALID_PROJECT_NAMES and improved the error message. Thanks for the patch, ubernostrum

Note: See TracTickets for help on using tickets.
Back to Top