[Django] pythonと同じモジュールのプロジェクトは作れません
移転しました。
例えば、
# python /home/shohu/test/list_module.py | grep hoge hoge.__init__ hoge.core hoge.logger.__init__
のようなhogeというモジュール名があるとすると、以下のようなエラーが発生してプロジェクトが作成できなかったり、runserverできなくなります。
# django-admin.py startproject hoge Error: 'hoge' conflicts with the name of an existing Python module and cannot be used as a project name. Please try another name. や、 # python manage.py runserver Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 272, in execute_manager utility.execute() File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 219, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 172, in fetch_command app_name = get_commands(self.user_commands, self.project_directory)[subcommand] File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 86, in get_commands for app_name in settings.INSTALLED_APPS: File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 28, in __getattr__ self._import_settings() File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 59, in _import_settings self._target = Settings(settings_module) File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 86, in __init__ raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e) ImportError: Could not import settings 'hoge.settings' (Is it on sys.path? Does it have syntax errors?): No module named settings