1. Download the latest release from our download page.
2. Untar the downloaded file (e.g. tar xzvf Django-X.Y.tar.gz, where X.Y is the version number of the latest release). If you're using Windows, you can download the command-line tool bsdtar to do this, or you can use a GUI-based tool such as 7-zip.
3. Change into the directory created in step 2 (e.g. cd Django-X.Y).
4. If you're using Linux, Mac OS X or some other flavor of Unix, enter the command sudo python setup.py install at the shell prompt. If you're using Windows, start a command shell with administrator privileges and run the commandpython setup.py install. This will install Django in your Python installation's site-packages directory.
安装完Django 以后,用deactivate命令,退出virtualenv。
第四部,安装Postgresql
因为Ubuntu 12.10自带 Postgresql 9.1, 就不用下载了,直接在terminal 里输入命令行就可以安装。
命令行如下:
sudo apt-get install postgresql-9.1
然后安装必要的包,附上官网的介绍及网址。有些包在之前可能已经被安装过了,但是保险起见,还是按照官方的介绍安装一边。
http://www.postgresql.org/download/linux/ubuntu/
* postgresql-client-9.1 - client libraries and client binaries
* postgresql-9.1 - core database server
* postgresql-contrib-9.1 - additional supplied modules
* libpq-dev - libraries and headers for C language frontend development
* postgresql-server-dev-9.1 - libraries and headers for C language backend development
* pgadmin3 - pgAdmin III graphical administration utility
只要把命令行里的postgresql-9.1 替换为下面包的名字即可。比方说,需要安装postgresql-client-9.1,就输入
sudo apt-get install postgresql-client-9.1
下面的都一样。
安装完postgresql以后,需要对数据库进行一些设置,比方说添加role,以及创建数据库等。具体方法如下:
设置postgresql 的用户以及密码
sudo -u postgres createuser
然后按照提示添加用户
第一个提示是输入用户名,然后问这个用户是不是超级用户,是不是允许创建数据库,是不是允许添加新的用户。按照需要回答,就可以创建一个用户。
创建一个数据库
sudo -u postgres createdb mydb
#mydb 是数据库的名字,可以按自己意愿设置
创建完以后用psql命令设置刚刚创建的用户的密码,以及赋予这个用户权限访问数据库
sudo -u postgres psqlpostgres=# alter user linuxpoison with encrypted password 'password';
ALTER ROLE
postgres=# grant all privileges on database linuxdb to linuxpoison;
GRANT
之后可以使用\l看到已经成功创建的数据库以及这个刚刚被添加的用户以及有了权限访问这个数据库。
1. Open the project settings, and click Python Interpreters page.
2. Click in the toolbar.
Create New Virtual Environment dialog box opens.
3. In the Create New Virtual Environment dialog box:
* In the Name field, type the name of the new virtual environment, or accept the suggested default name.
* In the Location field, specify the target directory, where the new virtual environment will be created.
* From Base interpreter drop-down list, select one of the configured Python interpreters, which will be used as the base for the new virtual environment.
* If you want the site-packages of the base interpreter to be visible from the virtual environment, select the check box Inherit global site-packages. If you leave this check box cleared, the new virtual environment will be completely isolated.
* 2.6+ If you want to assign the new virtual environment to be the project interpreter, make sure that the corresponding check box is selected.Also, you can make this virtual environment available to all projects, same as when an existing virtual environment is added.