如何让PostgresSQL在带有django的Windows 7电脑上工作? [英] How to get postgresSQL to work on a windows 7 computer with django?

查看:174
本文介绍了如何让PostgresSQL在带有django的Windows 7电脑上工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读 django book ,他们的说明不正常为了我。人们正在谈论编辑他们的路径,并在评论中需要充分的路径,我真的不知道他们在说什么是诚实的。我得到django安装正确,但我不能为我的生活形象。对人们的评论的任何建议或解释将不胜感激。

I'm currently reading the django book and their instructions aren't working for me. People are talking about editing their paths and needing full paths in the comments and I really just have no idea what they are talking about to be honest. I got django to install correctly but I can't for the life of me figure this out. Any suggestions or explanations of peoples comment would be greatly appreciated.

推荐答案

在做任何事情之前,请确保您有 C:\Python27\Scripts 添加到您的 PATH 中,这是大多数软件包安装其脚本的地方(如django-admin.py)。

Before you do anything, make sure that you have C:\Python27\Scripts added to your PATH, this is where most packages install their scripts (such as django-admin.py).

C:\Python27 替换为系统中安装Python的位置

Replace C:\Python27 with wherever Python is installed in your system

一旦你这样做,打开一个新的命令提示符,所以系统将读取 PATH

Once you have done that, open a new command prompt so the system will read the PATH.

C:\> python django-admin.py startproject myproject

应该没有任何问题。

接下来,安装postgresql。最简单的方法是使用一键安装程序

Next, install postgresql. The easiest way is to use the one click installer.

最后,下载适用于Windows的 pyscopg库。确保您选择与您的Python版本相对应的。

Finally, download the pyscopg library for Windows. Make sure you pick the one that corresponds with your version of Python.

现在,您可以通过在postgresql中创建数据库来继续。使用pgadmin工具(称为 pgadmin III )。

Now you can continue by creating a database in postgresql. Use the pgadmin tool (called pgadmin III).


  1. 展开服务器在左窗格下的服务器组

  2. 双击列出的服务器(应为 PostgreSQL 9.0(localhost:5432))。这将连接到服务器。您需要使用安装程序中设置的密码。

  3. 右键单击登录角色,然后选择新角色

  4. 填写角色名称(这是用户的登录名)

  5. 输入两个密码。

  6. 单击确定。

  7. 右键单击 / code>,并选择新数据库..

  8. 给它一个名字

  9. 所有者字段中,在步骤4中输入您在角色名称中输入的名称。

  10. 单击确定

  1. Expand the Servers tree under Server Groups on the left pane.
  2. Double click on the server listed (should be PostgreSQL 9.0 (localhost:5432)). This connects you to the server. You need to use the password you set up in the installer.
  3. Right click on Login Roles, and select New Role..
  4. Fill in the Role name (this is the user's login name)
  5. Enter two passwords.
  6. Click OK.
  7. Right click on Databases, and select New Database..
  8. Give it a name
  9. In the Owner field, enter the name you entered in Role name in step 4.
  10. Click OK

从这里开始,您可以按照教程中的说明进行操作。

From here on, you can follow the instructions in the tutorial.

这篇关于如何让PostgresSQL在带有django的Windows 7电脑上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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