I am trying to get the basic tutorial examples working but keep running
into a problem importing the app.  After I create the polls app as
suggested in the tutorial
(http://www.djangoproject.com/documentation/tutorial1/), put the sample
code into polls/models/polls.py and add 'myproject.apps.polls' to
myprojects/settings.py, I try to run

django-admin.py sql polls

which gives me the following error message:

Traceback (most recent call last):
  File "/usr/bin/django-admin.py", line 5, in ?
    pkg_resources.run_script('Django==0.90', 'django-admin.py')
  ...
  File
"/usr/lib/python2.4/site-packages/Django-0.90-py2.4.egg/django/utils/translation.py",
line 164, in _fetch
    app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]),
appname[p+1:])
AttributeError: 'module' object has no attribute 'polls'

(Full stack trace at the end of the message)

I get the exact same error message if I just go into the python console
and try to import the models manually with "from django.models.polls
import polls, choices"

My project directory is symlinked into
/usr/lib/python2.4/site-packages/ and I can import the project settings
with "import myproject.settings"   The database is set up (using mysql)
and seems to have gotten initialized correctly.  I've tried with both
python 2.3 and 2.4 and I get the same result.

I have a copy of all the files I am using in
http://www.freewisdom.org/tmp/django/ (though, all of them are straight
out of the tutorial).

Any suggestions?

  - yuri

The full stack trace:

Traceback (most recent call last):
  File "/usr/bin/django-admin.py", line 5, in ?
    pkg_resources.run_script('Django==0.90', 'django-admin.py')
  File
"/usr/lib/python2.4/site-packages/setuptools-0.6a7-py2.4.egg/pkg_resources.py",
line 407, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File
"/usr/lib/python2.4/site-packages/setuptools-0.6a7-py2.4.egg/pkg_resources.py",
line 920, in run_script
    execfile(script_filename, namespace, namespace)
  File
"/usr/lib/python2.4/site-packages/Django-0.90-py2.4.egg/EGG-INFO/scripts/django-admin.py",
line 139, in ?
    main()
  File
"/usr/lib/python2.4/site-packages/Django-0.90-py2.4.egg/EGG-INFO/scripts/django-admin.py",
line 81, in main
    translation.activate('en-us')
  File
"/usr/lib/python2.4/site-packages/Django-0.90-py2.4.egg/django/utils/translation.py",
line 192, in activate
    _active[currentThread()] = translation(language)
  File
"/usr/lib/python2.4/site-packages/Django-0.90-py2.4.egg/django/utils/translation.py",
line 181, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File
"/usr/lib/python2.4/site-packages/Django-0.90-py2.4.egg/django/utils/translation.py",
line 164, in _fetch
    app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]),
appname[p+1:])
AttributeError: 'module' object has no attribute 'polls'

Reply via email to