On 11/7/05, Waylan Limberg <[EMAIL PROTECTED]> wrote:
> On 11/7/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
> >
> >
> > Django isn't finding your settings.py file. It's falling back to
> > "postgresql" because that's the default fallback (according to the
> > file django/conf/global_settings.py).
>
> That's what I suspected.
>
> >
> > Make sure your "myproject" directory is on the PYTHONPATH. You should
> > be able to switch to another, unrelated directory -- such as "/temp/"
> > -- start the Python interactive interpreter and type "import
> > myproject.settings".
> >
>
> Yeah, I've done just that, except I just did 'import myproject'. Never
> thought to try  "import myproject.settings". I'll have to give that a
> try when I get home tonight.
>
Below is the behavior I'm getting from the Python shell. I get the
same (with the file path adjusted) no matter where I am in the file
system when starting the shell.

    Python 2.3.5 (#2, Sep  4 2005, 22:01:42)
    [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import myproject
    >>> myproject
    <module 'myproject' from 'myproject/__init__.pyc'>
    >>> myproject.settings
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    AttributeError: 'module' object has no attribute 'settings'
    >>> import myproject.settings
    >>> myproject.settings
    <module 'myproject.settings' from 'myproject/settings.pyc'>
    >>>

Then I closed the python shell out and tried again doing this:

    Python 2.3.5 (#2, Sep  4 2005, 22:01:42)
    [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> myproject
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    NameError: name 'myproject' is not defined
    >>> import myproject.settings
    >>> myproject
    <module 'myproject' from 'myproject/__init__.pyc'>
    >>> myproject.settings
    <module 'myproject.settings' from 'myproject/settings.pyc'>
    >>>

This is the exact same bahavior I get on my other boxes where things
work without problem. Also of note is that the first time I did
'import myproject.settings' a settings.pyc file was created. Of
course, that just confirms that django-admin.py is not finding the
file. After noting that the pyc file exists, I tried running
'django-admin.py init' again, but still a no-go. I'm at a lose as to
what else could be causing the problem.



--
----
Waylan Limberg
[EMAIL PROTECTED]

Reply via email to