2

I've recently started my first Django project. I have previously been able to run the command 'python manage.py runserver' without returning any errors but now it returns a long error message which I can't solve...

 File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 8, in <module>
    from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 26, in <module>
    from django.views import static
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/views/static.py", line 95, in <module>
    template_translatable = ugettext_noop(u"Index of %(directory)s")
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
    return _trans.gettext_noop(message)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
    if settings.USE_I18N:
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 95, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'twitter.settings' (Is it on sys.path?): No module named settings

I'm not sure why it's returning this error. The only thing I can think of that might have affected it is that I have recently downloaded and installed the python-twitter library as I'm using the Twitter API in my project. Any help on how to solve this would be very much appreciated!

Thanks,

Jess

Sebastian Paaske Tørholm
  • 49,493
  • 11
  • 100
  • 118
Jess
  • 1,749
  • 4
  • 16
  • 17

1 Answers1

2

I'm not familiar with the python-twitter library, but my guess is that the module is named twitter. So you may be trying to pull in an attribute called "settings" from your python-twitter library. You may want to change your project name.

D.A
  • 2,555
  • 1
  • 14
  • 10
  • Thanks D.A, I think it might be saying twitter.settings because the name of my file is currently 'twitter' until I come up with a name for my project. Do you think that could be why it is saying twitter.settings? – Jess Aug 12 '12 at 15:07
  • The name of your project is whatever you put in when you ran the command `django-admin.py runproject `. Which, according to the logs, is "twitter". So my guess is that you are conflicting with the module "twitter" that you installed. – D.A Aug 12 '12 at 16:10
  • OK, that makes sense. Thank you. I'll change the name of my project to something other than twitter and see if that works. Thank you for your help! – Jess Aug 13 '12 at 09:16