﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1908	Having an app name the same as project name breaks manage.py ( unable to import projectname.settings )	simon@…	Adrian Holovaty	"When a project has an app with the same name, manage.py breaks. 

This might seem like a trivial example - there's probably a good argument to be made why a projectname should be different to an appname, but I think this problem will crop up often on small apps.


Step 1: Create Project fudge & test
{{{
minerva:~ simon$ django-admin.py startproject fudge
minerva:~ simon$ cd fudge/
minerva:~/fudge simon$ ls
__init__.py     manage.py       settings.py     urls.py
minerva:~/fudge simon$ python manage.py runserver 80808
Validating models...
0 errors found.

Django version 0.95 (post-magic-removal), using settings 'fudge.settings'
Development server is running at http://127.0.0.1:80808/
Quit the server with CONTROL-C.
}}}

Step 2: add an app, also called fudge & try to runserver

{{{
minerva:~/fudge simon$ python manage.py startapp fudge
minerva:~/fudge simon$ python manage.py runserver 80808
Traceback (most recent call last):
  File ""manage.py"", line 11, in ?
    execute_manager(settings)
  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py"", line 1237, in execute_manager
    execute_from_command_line(action_mapping)
  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py"", line 1158, in execute_from_command_line
    translation.activate('en-us')
  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/utils/translation.py"", line 195, in activate
    _active[currentThread()] = translation(language)
  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/utils/translation.py"", line 120, in translation
    if settings.SETTINGS_MODULE is not None:
  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/conf/__init__.py"", line 28, in __getattr__
    self._import_settings()
  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/conf/__init__.py"", line 55, in _import_settings
    self._target = Settings(settings_module)
  File ""/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/conf/__init__.py"", line 83, 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 'fudge.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings
}}}

Step 3. Remove fudge app, and try with another app:

{{{
minerva:~/fudge simon$ rm -rf fudge/
minerva:~/fudge simon$ python manage.py startapp bork
minerva:~/fudge simon$ python manage.py runserver 80808
Validating models...
0 errors found.

Django version 0.95 (post-magic-removal), using settings 'fudge.settings'
Development server is running at http://127.0.0.1:80808/
Quit the server with CONTROL-C.
}}}
"	Bug	closed	Core (Management commands)	dev	Normal	fixed		albrecht.andi@… techtonik@… lrekucki@… Yaşar Arabacı darkowlzz	Accepted	0	0	0	0	1	1
