为django项目设置postgreSQL数据库时遇到问题 [英] Problems setting up a postgreSQL database for a django project

查看:111
本文介绍了为django项目设置postgreSQL数据库时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Python / Django的新手,所以原谅我,如果这是一个简单的问题来解决...

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

我正在设置一个PostgreSQL数据库对于我的Django项目我从这里下载了PostgreSQL 9.2。 http://www.postgresql.org/download/macosx/并经过安装过程。我一直在跟踪一个维基文章,说要更新我的系统路径到/Library/PostgreSQL/9.2/bin,我有。当我在终端I中输入'nano〜/ .bash_profile'时,看到这个'PATH ='Library / PostgreSQL / 9.2 / bin',我相信我已经正确地更新了我的系统路径。但是,当我尝试运行命令'createdb'时,我看到这个...

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

-bash: createdb: command not found

我相信我已经正确安装了PostgreSQL,所以我不知道如何解决这个问题。

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

任何帮助将非常感谢!

谢谢

Jess

推荐答案

PATH ='Library / PostgreSQL / 9.2 / bin正在覆盖您的全局$ PATH PostgreSQL二进制文件应该是:

PATH ='Library/PostgreSQL/9.2/bin is overwriting your global $PATH with just the PostgreSQL binaries. It should be the following instead:

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

这将PostgreSQL bin目录追加到$ PATH,而不是覆盖它。编辑后不要忘记开始新的终端会话,或在当前会话中执行以下操作:

This appends the PostgreSQL bin directory to your $PATH, instead of overwriting it. Don't forget to start a new terminal session after you make the edit, or do the following in your current session:

source ~/.bash_profile

一般来说,在OSX上安装开源软件,软件包和实用程序的最佳方式要使用自制软件。 Homebrew是OSX的软件包管理器,用于简化PostgreSQL等许多开源项目的安装和管理。看看吧!

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 to simplify the installation and management of programs such as PostgreSQL, and many other popular open source projects. Check it out!

这篇关于为django项目设置postgreSQL数据库时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆