Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » django-admin not seeing settings.py [RSS Feed]

#1 Nov. 7, 2005 05:33:03

Waylan L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


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

Offline

#2 Nov. 7, 2005 05:37:07

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


On Monday 07 Nov 2005 11:02 am, Waylan Limberg wrote:
> 'django-admin.py init --settings=myproject.settings'. I get the
> following error:

only possibility is that you have two 'myproject' directories and your
path is set to the second one - afaik, by default, settings.py uses
postgresql

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

Offline

#3 Nov. 7, 2005 05:51:11

l.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


2005/11/7, 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?

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/limodouNewEdit Maillist:http://groups.google.com/group/NewEdit

Offline

#4 Nov. 7, 2005 06:10:51

Waylan L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


On 11/7/05, Kenneth Gonsalves <> wrote:
>
> On Monday 07 Nov 2005 11:02 am, Waylan Limberg wrote:
> > 'django-admin.py init --settings=myproject.settings'. I get the
> > following error:
>
> only possibility is that you have two 'myproject' directories and your
> path is set to the second one - afaik, by default, settings.py uses
> postgresql
>
I just did the following as root:

updatedb
locate myproject

and there is definitely only one 'myproject' directory on the system
and only one setting.py file in that dir.


--
----
Waylan Limberg

Offline

#5 Nov. 7, 2005 06:26:27

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


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
kghttp://www.livejournal.com/users/lawgontally ho!http://avsap.org.inಇಂಡ್ಲಿನಕ್ಸ வாழ்க!

Offline

#6 Nov. 7, 2005 06:28:23

Waylan L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


On 11/7/05, limodou <> wrote:
>
> 2005/11/7, 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?
>
> 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

Offline

#7 Nov. 7, 2005 06:32:24

Waylan L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


On 11/7/05, Kenneth Gonsalves <> 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

Offline

#8 Nov. 7, 2005 06:43:53

Waylan L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


> 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

Offline

#9 Nov. 7, 2005 07:21:47

l.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


> 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/limodouNewEdit Maillist:http://groups.google.com/group/NewEdit

Offline

#10 Nov. 7, 2005 09:35:31

Marcos S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

django-admin not seeing settings.py


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

Offline

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support