Re: django-admin not seeing settings.py

2005-11-16 Thread Waylan Limberg

On 11/16/05, felix <[EMAIL PROTECTED]> wrote:
>
> and note that the PYTHON_PATH should specify the *parent* directory of
> your project.
>
> I just tried it again with DJANGO_SETTINGS_MODULE **not** exported and
> passing in django-admin.py --settings=myproject.settings
>
> that does not work, you have to set/export DJANGO_SETTINGS_MODULE
>
Yeah, I finally got it to work after re-exporting
DJANGO_SETTINGS_MODULE. Whenever I used   
--settings=myproject.settings it refused to work. Maybe I had a typo
the first time I exported DJANGO_SETTINGS_MODULE or something.


--

Waylan Limberg
[EMAIL PROTECTED]


Re: django-admin not seeing settings.py

2005-11-16 Thread felix

and note that the PYTHON_PATH should specify the *parent* directory of
your project.

I just tried it again with DJANGO_SETTINGS_MODULE **not** exported and
passing in django-admin.py --settings=myproject.settings

that does not work, you have to set/export DJANGO_SETTINGS_MODULE

thanks



Re: django-admin not seeing settings.py

2005-11-10 Thread Luke Plant

On Thu, 10 Nov 2005 12:16:47 -0500 Waylan Limberg wrote:

> 
> On 11/10/05, James Bennett <[EMAIL PROTECTED]> wrote:
> >
> > On 11/10/05, felix <[EMAIL PROTECTED]> wrote:
> > > do this:
> > > export DJANGO_SETTINGS_MODULE=myproject.settings
> >
> > Yeah, that's mentioned in the documentation. Perhaps what was
> > happening was that you'd changed a .bash_profile or .bashrc file to
> > set your DJANGO_SETTINGS_MODULE and PYTHONPATH, and then hadn't
> > exported those values or sourced the file?
> >
> I still don't have it working for me, and I did the export
> DJANGO_SETTINGS_MODULE=myproject.settings thing. Whats the best way to
> see what your PYTHONPATH is set to and change it? Maybe something is
> wrong there. (I'm on Debian with python 2.3)

For my interactive sessions, I run the following commands (I actually
have them in a file devel.py, and I cd to the folder containing
devel.py, and do "import devel" from within a python session):

import sys
import os
sys.path = sys.path + ['/path/to/my/app/','/path/to/django/src/']
os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'

Alternatively, to set it permanently, put the export PYTHONPATH and
DJANGO_SETTINGS_MODULE settings in your ~/.bashrc, then start a new
bash session.


Luke
Luke
-- 

"I washed a sock. Then I put it in the dryer. When I took it out, it 
was gone."  (Steven Wright)

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/


Re: django-admin not seeing settings.py

2005-11-10 Thread James Bennett

On 11/10/05, Waylan Limberg <[EMAIL PROTECTED]> wrote:
> I still don't have it working for me, and I did the export
> DJANGO_SETTINGS_MODULE=myproject.settings thing. Whats the best way to
> see what your PYTHONPATH is set to and change it? Maybe something is
> wrong there. (I'm on Debian with python 2.3)

At a command line, type 'echo $PYTHONPATH' and hit Enter.

--
"May the forces of evil become confused on the way to your house."
  -- George Carlin


Re: django-admin not seeing settings.py

2005-11-10 Thread Waylan Limberg

On 11/10/05, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 11/10/05, felix <[EMAIL PROTECTED]> wrote:
> > do this:
> > export DJANGO_SETTINGS_MODULE=myproject.settings
>
> Yeah, that's mentioned in the documentation. Perhaps what was
> happening was that you'd changed a .bash_profile or .bashrc file to
> set your DJANGO_SETTINGS_MODULE and PYTHONPATH, and then hadn't
> exported those values or sourced the file?
>
I still don't have it working for me, and I did the export
DJANGO_SETTINGS_MODULE=myproject.settings thing. Whats the best way to
see what your PYTHONPATH is set to and change it? Maybe something is
wrong there. (I'm on Debian with python 2.3)


--

Waylan Limberg
[EMAIL PROTECTED]


Re: django-admin not seeing settings.py

2005-11-10 Thread Waylan Limberg

On 11/10/05, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 11/10/05, felix <[EMAIL PROTECTED]> wrote:
> > do this:
> > export DJANGO_SETTINGS_MODULE=myproject.settings
>
> Yeah, that's mentioned in the documentation. Perhaps what was
> happening was that you'd changed a .bash_profile or .bashrc file to
> set your DJANGO_SETTINGS_MODULE and PYTHONPATH, and then hadn't
> exported those values or sourced the file?
>
>
> --
> "May the forces of evil become confused on the way to your house."
>   -- George Carlin
>


--

Waylan Limberg
[EMAIL PROTECTED]


Re: django-admin not seeing settings.py

2005-11-10 Thread James Bennett

On 11/10/05, felix <[EMAIL PROTECTED]> wrote:
> do this:
> export DJANGO_SETTINGS_MODULE=myproject.settings

Yeah, that's mentioned in the documentation. Perhaps what was
happening was that you'd changed a .bash_profile or .bashrc file to
set your DJANGO_SETTINGS_MODULE and PYTHONPATH, and then hadn't
exported those values or sourced the file?


--
"May the forces of evil become confused on the way to your house."
  -- George Carlin


Re: django-admin not seeing settings.py

2005-11-10 Thread felix

ok mine is working now.

do this:
export DJANGO_SETTINGS_MODULE=myproject.settings

and thereafter all the django-admin.py commands work correctly.



Re: django-admin not seeing settings.py

2005-11-10 Thread felix


> 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.

Same situation for me.  I specify mysql, but it complains of postgresql
problems.  Its not finding the settings file.

> > > 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".

I tried this through the interpreter, same results as Waylan.  I'm new
to python, but I wouldn't expect a python environment variable to
remain persistent across interpreter sessions.  Are they really
supposed to ?  If so, how long would they persist ?

Tried django-admin.py init --pythonpath=/Users/me/Sites/djangotest
--settings=myproject.settings
Didn't work.  This is maybe a problem in django-admin ?

I tried setting the unix envir variable PYTHONPATH
Still doesn't find it.

thanks all.



Re: django-admin not seeing settings.py

2005-11-07 Thread Waylan Limberg

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

>>> myproject.settings
Traceback (most recent call last):
  File "", line 1, in ?
AttributeError: 'module' object has no attribute 'settings'
>>> import myproject.settings
>>> myproject.settings

>>>

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 "", line 1, in ?
NameError: name 'myproject' is not defined
>>> import myproject.settings
>>> myproject

>>> myproject.settings

>>>

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]


Re: django-admin not seeing settings.py

2005-11-07 Thread rockmh

I am using FCGI on my host and I find that I am often required to
"pkill python" in order to make certain types of changes actually show
up. Annoying, but not a problem for my users. Just a thought...



Re: django-admin not seeing settings.py

2005-11-07 Thread Waylan Limberg

On 11/7/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
>
> On 11/6/05, Waylan Limberg <[EMAIL PROTECTED]> wrote:
> > I'v gone through the first toturial before on another box no problem,
> > but on this machine I can't seem to get it to work. After setting the
> > database conection info in myproject/settings.py I try to run
> > 'django-admin.py init --settings=myproject.settings'. I get the
> > following error:
> >
> > Error: The database couldn't be initialized.
> > Could not load database backend: No module named psycopg. Is your
> > DATABASE_ENGINE setting (currently 'postgresql') spelled correctly?
> > Available optionas are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'
> >
> > The thing is that I DO NOT have it set to 'postgresql' in
> > myproject/setting.py but have tried both 'mysql' and 'sqlite3'. I
> > still get the same message. Oh, and I can 'import myproject' from the
> > Python interactive prompt without problem, so I know thats not it.
> > I've tried setting the 'DJANGO_SETTINGS_MODULE' or using the
> > '--settings' option, but nothing seems to make a difference. Any
> > suggestions?
>
> 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.

BTW, I noticed that django-admin.py has a '--pythonpath' option to add
to the python path. However, I haven't seen any mention in the docs
about it. I couldn't seem to get it to do anything. Seems to me that a
mention of it at the appropriate place in the first tutorial would be
helpful to those not sure how to set PYTHONPATH. Personally, I'm not
sure if I overwrote it only with the path to myproject or if I added
to it. Maybe some clear direction there would help. The link in the
tutorial is of no real use. It just explains what it is. Nothing about
how to set it etc.


--

Waylan Limberg
[EMAIL PROTECTED]


Re: django-admin not seeing settings.py

2005-11-07 Thread Adrian Holovaty

On 11/6/05, Waylan Limberg <[EMAIL PROTECTED]> wrote:
> I'v gone through the first toturial before on another box no problem,
> but on this machine I can't seem to get it to work. After setting the
> database conection info in myproject/settings.py I try to run
> 'django-admin.py init --settings=myproject.settings'. I get the
> following error:
>
> Error: The database couldn't be initialized.
> Could not load database backend: No module named psycopg. Is your
> DATABASE_ENGINE setting (currently 'postgresql') spelled correctly?
> Available optionas are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'
>
> The thing is that I DO NOT have it set to 'postgresql' in
> myproject/setting.py but have tried both 'mysql' and 'sqlite3'. I
> still get the same message. Oh, and I can 'import myproject' from the
> Python interactive prompt without problem, so I know thats not it.
> I've tried setting the 'DJANGO_SETTINGS_MODULE' or using the
> '--settings' option, but nothing seems to make a difference. Any
> suggestions?

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).

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".

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org


Re: django-admin not seeing settings.py

2005-11-07 Thread stan8688

I got this problem too. when i use postgresql.

but I solved it . when I drop old db and
create new db set owner=postgres , tablespace= pg_default and public .

maybe you are the same problem. holp to help you.


Waylan Limberg wrote:
> I'v gone through the first toturial before on another box no problem,
> but on this machine I can't seem to get it to work. After setting the
> database conection info in myproject/settings.py I try to run
> 'django-admin.py init --settings=myproject.settings'. I get the
> following error:
>
> Error: The database couldn't be initialized.
> Could not load database backend: No module named psycopg. Is your
> DATABASE_ENGINE setting (currently 'postgresql') spelled correctly?
> Available optionas are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'
>
> The thing is that I DO NOT have it set to 'postgresql' in
> myproject/setting.py but have tried both 'mysql' and 'sqlite3'. I
> still get the same message. Oh, and I can 'import myproject' from the
> Python interactive prompt without problem, so I know thats not it.
> I've tried setting the 'DJANGO_SETTINGS_MODULE' or using the
> '--settings' option, but nothing seems to make a difference. Any
> suggestions?
> --
> 
> Waylan Limberg
> [EMAIL PROTECTED]



Re: django-admin not seeing settings.py

2005-11-07 Thread Marcos Sánchez Provencio

You might try executing python with the -v option


El lun, 07-11-2005 a las 15:21 +0800, limodou escribió:
> > I just noticed that the line breaks (in the comments) on the first two
> > lines were actual line breaks, not just wrapping text. I fixed that,
> > but still no go. The last two lines are definitely wrapping text.
> >
> > It's still telling me the DATABASE_ENGINE is set to 'postgresql'
> >
> 
> maybe there is a settings directory and settings.py, if the situation
> is like this, you should delete the settings directory. I'v
> encountered this situation once, because of the admin manage changes.
> You should delete all django source code, and recheckout the code from
> svn.
> 
> --
> I like python!
> My Blog: http://www.donews.net/limodou
> NewEdit Maillist: http://groups.google.com/group/NewEdit
-- 
Marcos Sánchez Provencio <[EMAIL PROTECTED]>



Re: django-admin not seeing settings.py

2005-11-06 Thread limodou

> I just noticed that the line breaks (in the comments) on the first two
> lines were actual line breaks, not just wrapping text. I fixed that,
> but still no go. The last two lines are definitely wrapping text.
>
> It's still telling me the DATABASE_ENGINE is set to 'postgresql'
>

maybe there is a settings directory and settings.py, if the situation
is like this, you should delete the settings directory. I'v
encountered this situation once, because of the admin manage changes.
You should delete all django source code, and recheckout the code from
svn.

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit


Re: django-admin not seeing settings.py

2005-11-06 Thread Waylan Limberg

> DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3' or
> 'ado_mssql'.
> DATABASE_NAME = 'djangodb' # Or path to database file if
> using sqlite3.
> DATABASE_USER = 'username' # Not used with sqlite3.
> DATABASE_PASSWORD = 'pass' # Not used with sqlite3.
> DATABASE_HOST = '' # Set to empty string for localhost.
> Not used with sqlite3.
> DATABASE_PORT = '' # Set to empty string for default. Not
> used with sqlite3.
>
> Here it is. The username and password are different, but everything
> else is the same.

I just noticed that the line breaks (in the comments) on the first two
lines were actual line breaks, not just wrapping text. I fixed that,
but still no go. The last two lines are definitely wrapping text.

It's still telling me the DATABASE_ENGINE is set to 'postgresql'


--

Waylan Limberg
[EMAIL PROTECTED]


Re: django-admin not seeing settings.py

2005-11-06 Thread Waylan Limberg

On 11/7/05, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> On Monday 07 Nov 2005 11:40 am, Waylan Limberg wrote:
> > and there is definitely only one 'myproject' directory on the system
> > and only one setting.py file in that dir.
>
> could you paste the database part of your settings.py file somewhere?
>
DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3' or
'ado_mssql'.
DATABASE_NAME = 'djangodb' # Or path to database file if
using sqlite3.
DATABASE_USER = 'username' # Not used with sqlite3.
DATABASE_PASSWORD = 'pass' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

Here it is. The username and password are different, but everything
else is the same.
--

Waylan Limberg
[EMAIL PROTECTED]


Re: django-admin not seeing settings.py

2005-11-06 Thread Waylan Limberg

On 11/7/05, limodou <[EMAIL PROTECTED]> wrote:
>
> 2005/11/7, Waylan Limberg <[EMAIL PROTECTED]>:
> >
> > I'v gone through the first toturial before on another box no problem,
> > but on this machine I can't seem to get it to work. After setting the
> > database conection info in myproject/settings.py I try to run
> > 'django-admin.py init --settings=myproject.settings'. I get the
> > following error:
> >
> > Error: The database couldn't be initialized.
> > Could not load database backend: No module named psycopg. Is your
> > DATABASE_ENGINE setting (currently 'postgresql') spelled correctly?
> > Available optionas are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'
> >
> > The thing is that I DO NOT have it set to 'postgresql' in
> > myproject/setting.py but have tried both 'mysql' and 'sqlite3'. I
> > still get the same message. Oh, and I can 'import myproject' from the
> > Python interactive prompt without problem, so I know thats not it.
> > I've tried setting the 'DJANGO_SETTINGS_MODULE' or using the
> > '--settings' option, but nothing seems to make a difference. Any
> > suggestions?
>
> if you set sqlite3, I tried myself, you should also need to install
> pysqlite2 package, and also need to set DATABASE_NAME variable, and
> also need to use sqlite3 command tool to create a database file,
> django-admin.py will not create one for you. It's my experience.
>
>
Actually I was using MySQL, but on my other box I used sqlite without
problems, so I know whats required there. And yes, I have created the
DB in MySQL and have pyMySQLdb installed. The problem seems to be its
ignoring my setting.py file.


--

Waylan Limberg
[EMAIL PROTECTED]


Re: django-admin not seeing settings.py

2005-11-06 Thread Kenneth Gonsalves

On Monday 07 Nov 2005 11:40 am, Waylan Limberg wrote:
> and there is definitely only one 'myproject' directory on the system
> and only one setting.py file in that dir.

could you paste the database part of your settings.py file somewhere?

-- 
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!


Re: django-admin not seeing settings.py

2005-11-06 Thread limodou

2005/11/7, Waylan Limberg <[EMAIL PROTECTED]>:
>
> I'v gone through the first toturial before on another box no problem,
> but on this machine I can't seem to get it to work. After setting the
> database conection info in myproject/settings.py I try to run
> 'django-admin.py init --settings=myproject.settings'. I get the
> following error:
>
> Error: The database couldn't be initialized.
> Could not load database backend: No module named psycopg. Is your
> DATABASE_ENGINE setting (currently 'postgresql') spelled correctly?
> Available optionas are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'
>
> The thing is that I DO NOT have it set to 'postgresql' in
> myproject/setting.py but have tried both 'mysql' and 'sqlite3'. I
> still get the same message. Oh, and I can 'import myproject' from the
> Python interactive prompt without problem, so I know thats not it.
> I've tried setting the 'DJANGO_SETTINGS_MODULE' or using the
> '--settings' option, but nothing seems to make a difference. Any
> suggestions?

if you set sqlite3, I tried myself, you should also need to install
pysqlite2 package, and also need to set DATABASE_NAME variable, and
also need to use sqlite3 command tool to create a database file,
django-admin.py will not create one for you. It's my experience.


--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit


django-admin not seeing settings.py

2005-11-06 Thread Waylan Limberg

I'v gone through the first toturial before on another box no problem,
but on this machine I can't seem to get it to work. After setting the
database conection info in myproject/settings.py I try to run
'django-admin.py init --settings=myproject.settings'. I get the
following error:

Error: The database couldn't be initialized.
Could not load database backend: No module named psycopg. Is your
DATABASE_ENGINE setting (currently 'postgresql') spelled correctly?
Available optionas are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'

The thing is that I DO NOT have it set to 'postgresql' in
myproject/setting.py but have tried both 'mysql' and 'sqlite3'. I
still get the same message. Oh, and I can 'import myproject' from the
Python interactive prompt without problem, so I know thats not it.
I've tried setting the 'DJANGO_SETTINGS_MODULE' or using the
'--settings' option, but nothing seems to make a difference. Any
suggestions?
--

Waylan Limberg
[EMAIL PROTECTED]