Code

Opened 7 years ago

Closed 7 years ago

#3299 closed defect (fixed)

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

Reported by: anonymous Owned by: adrian
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: UI/UX:

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 ubernostrum 7 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 Changed 7 years ago by ubernostrum

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).

Changed 7 years ago by ubernostrum

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

comment:2 Changed 7 years ago by ubernostrum

  • Summary changed from the name of project cannot have the name "site" to [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 Changed 7 years ago by Simon G. <dev@…>

  • Keywords site INVALID_PROJECT_NAMES added
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:4 Changed 7 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.