# Django: Linking Python to PostgreSQL

**URL:** <https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958>\
**Category:** programming\
**Created:** [May 21, 2008, 1:53pm UTC](https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958 "2008-05-21T13:53:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nobody](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nobody](https://forum.kirupa.com/u/nobody)\
**Post date:** [May 21, 2008, 1:53pm UTC](https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958/1 "2008-05-21T13:53:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nobody](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nobody](https://forum.kirupa.com/u/nobody)\
**Post date:** [May 22, 2008, 3:55am UTC](https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958/2 "2008-05-22T03:55:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [May 22, 2008, 4:07am UTC](https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958/3 "2008-05-22T04:07:24Z")

</div>

> 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](http://www.microsoft.com/powershell) might be marginally more exciting for you.

---

<div class="post-metadata">

**Author:** ![nobody](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nobody](https://forum.kirupa.com/u/nobody)\
**Post date:** [May 22, 2008, 5:12pm UTC](https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958/4 "2008-05-22T17:12:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![actionAction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/actionaction/32/3987_2.png) [@actionAction](https://forum.kirupa.com/u/actionAction)\
**Post date:** [May 22, 2008, 11:45pm UTC](https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958/5 "2008-05-22T23:45:29Z")

</div>

I use IDLE (Python GUI), which is about 3 steps better than command line.

---

<div class="post-metadata">

**Author:** ![Jeff\_Wheeler](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeff\_Wheeler](https://forum.kirupa.com/u/Jeff_Wheeler)\
**Post date:** [May 22, 2008, 11:49pm UTC](https://forum.kirupa.com/t/django-linking-python-to-postgresql/260958/6 "2008-05-22T23:49:07Z")

</div>

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 [font=monospace]./manage.py shell[/font] feature provided by Django should use it, rather than the default Python REPL.

[http://ipython.scipy.org/moin/Download](http://ipython.scipy.org/moin/Download)
