PDA

View Full Version : Django: Linking Python to PostgreSQL



nobody
May 21st, 2008, 10:53 AM
Hi everyone, I hope there's still some people here using Django.

I'm trying to get everything set up, I spent the entire day yesterday getting 95% of the way there. It's hard for me as I know nothing about command line stuff and I'm on Windows so there's no OS love for Python.

I got it working with SQLite which isn't really all that impressive. I'm trying to get it going with PostgreSQL and I'm running into errors linking errors, I guess. I don't fully understand what I'm doing, I'm just following README's and installing random packages. Sooo I have tried to install psycopg, and it seems like it went well. I compiled it with mingw32 and didn't get any errors, so I assumed that went well.

I believe that psycopg was supposed to link PostgreSQL with Python but when I fire up the Django server with the runserver command I get an error. Rather than type it all out and miss some important piece I've attached an image of the error.

Does anyone have any thoughts? I'm stuck and sort of frustrated because I've never been this close to installing before.

Also on a side note, is there anything better than the command prompt for doing all these console type things on Windows? It seems to suck pretty hard.

nobody
May 22nd, 2008, 12:55 AM
Figured it out. If anyone has similar problems it's very important to make sure you have download the correct version of psycopg(2), there's a table which couples versions of python to postgresql and I was too stupid to scroll down and check it out.

I'm now happily on my way to developing in Django.

Krilnon
May 22nd, 2008, 01:07 AM
Also on a side note, is there anything better than the command prompt for doing all these console type things on Windows?

http://www.microsoft.com/powershell might be marginally more exciting for you.

nobody
May 22nd, 2008, 02:12 PM
Sweet, I'll check it out.

Figured out the problem in case anyone searches this problem and stumbles upon this thread.
Had the wrong psycopg2 installed, make sure you get the right one. Stupid mistake, but I'm stupid so it makes sense.

actionAction
May 22nd, 2008, 08:45 PM
I use IDLE (Python GUI), which is about 3 steps better than command line.

Jeff Wheeler
May 22nd, 2008, 08:49 PM
IPython is also really nice (and available on most OSs). It features tab-completion and some nice help features. Once you have it installed, the ./manage.py shell feature provided by Django should use it, rather than the default Python REPL.

http://ipython.scipy.org/moin/Download