Problems setting up postgreSQL database for django project

I'm new to Python / Django, so forgive me if this is a simple problem to solve ...

I am trying to set up a PostgreSQL database for my Django project. I downloaded PostgreSQL 9.2 from here http://www.postgresql.org/download/macosx/ and went through the installation process. I am following a wiki article that says to update my system path to / Library / PostgreSQL / 9.2 / bin, which I have. When I type 'nano ~ / .bash_profile' into the Terminal, I see this "PATH =" Library / PostgreSQL / 9.2 / bin, which, I believe, means that I updated my system path correctly. However, when I try to run the "createdb" command, I see this ...

-bash: createdb: command not found 

I believe that PostgreSQL installed correctly, so I'm not sure how to get around this.

Any help would be greatly appreciated!

thank

Jess

+1
python django postgresql
03 Oct
source share
2 answers

PATH = 'Library / PostgreSQL / 9.2 / bin overwrites your global $ PATH with only PostgreSQL binaries. Instead, there should be the following:

 PATH="$PATH:/Library/PostgreSQL/9.2/bin" 

This adds the PostgreSQL bin directory to your $ PATH instead of overwriting it. Remember to start a new terminal session after making changes or do the following in the current session:

 source ~/.bash_profile 

In general, the best way to install open source software, packages and utilities on OSX is to use homebrew . Homebrew is a package manager for OSX that simplifies the installation and management of programs such as PostgreSQL and many other popular open source projects. Check this!

+2
Oct 03
source share

Although this is not exactly the answer to your "question", it can solve the problem for you. Have you checked the PostgreSQL application? It was created by Matt Thompson and is supported by Heroku Postgres and is designed to facilitate the development of PostgreSQL for people using Macs. You might want to take a look at it. Here is the link. Or just google "Postgresapp".

0
03 Oct
source share



All Articles