Step By Step设置Django
2013-08-06 10:22
344 查看
想在自己的Ubuntu Server虚拟机上搭建一个LAMP玩玩,P用Python,使用Django和PostgreSQL,在网上搜了半天,大部分文章都是很粗略,因此自己整理一个Step By Step,作为备忘
打开浏览器访问http://<your machine ip>/ 如果你可以看到Apache2的欢迎网页,那就代表成功了
安装完成后,需要设置默认用户 postgres的密码,并且创建一个数据库,后面会用到。这些命令适用于Ubuntu12.04上的Postgres9.1。
输入一下命令,进入Postgresql的界面更改密码
Then we connect as 'postgres'. The -h localhost part is important: it tells the psql client that we wish to connect using a TCP connection (which is configured to use password authentication), and not by a PEER connection (which does not care about the password).
I really wish they'd document all this in a more newcomer friendly fashion, instead of requiring a mandatory Google search and frustration.
login to the sample db to check your credential
https://docs.djangoproject.com/en/1.5/intro/tutorial01/
Please take below as reference if you can't execute "python manage.py syncdb"
input \dt to check table list
https://help.ubuntu.com/community/PostgreSQL https://www.digitalocean.com/community/articles/installing-django-on-ubuntu-12-04--4 https://www.digitalocean.com/community/articles/installing-mod_wsgi-on-ubuntu-12-04 https://docs.djangoproject.com/en/1.5/intro/tutorial01/
Install Django
下载最新的Django,然后解压安装wget https://www.djangoproject.com/download/1.5.1/tarball/ tar xzvf index.html sudo python setup.py install
Install WSGI
安装Apache2sudo aptitude install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
打开浏览器访问http://<your machine ip>/ 如果你可以看到Apache2的欢迎网页,那就代表成功了
sudo aptitude install libapache2-mod-wsgi sudo service apache2 restart
Install Postgresql
sudo apt-get install postgresql
安装完成后,需要设置默认用户 postgres的密码,并且创建一个数据库,后面会用到。这些命令适用于Ubuntu12.04上的Postgres9.1。
输入一下命令,进入Postgresql的界面更改密码
sudo -u postgres psql在界面下输入下面的命令然后输入新密码
\password
Then we connect as 'postgres'. The -h localhost part is important: it tells the psql client that we wish to connect using a TCP connection (which is configured to use password authentication), and not by a PEER connection (which does not care about the password).
psql -U postgres -h localhost
I really wish they'd document all this in a more newcomer friendly fashion, instead of requiring a mandatory Google search and frustration.
login to the sample db to check your credential
psql -h localhost -U postgres -d mydb
Create first Django site
在这里,我跟着Django网站的教程,一步一步的完成,暂时不重复这个过程了,可以在下面的链接找到内容。回头会整理一下比较重要的命令放在这里https://docs.djangoproject.com/en/1.5/intro/tutorial01/
Please take below as reference if you can't execute "python manage.py syncdb"
input \dt to check table list
Reference
下面是我设置的时候参考的一些比较有用的页面https://help.ubuntu.com/community/PostgreSQL https://www.digitalocean.com/community/articles/installing-django-on-ubuntu-12-04--4 https://www.digitalocean.com/community/articles/installing-mod_wsgi-on-ubuntu-12-04 https://docs.djangoproject.com/en/1.5/intro/tutorial01/
相关文章推荐
- Archie OSG Step By Step( 0) -OpenSceneGraph环境设置及第一个程序
- [Python]Django Step by Step 笔记(一)
- iptables入门教程--设置静态防火墙(step by step)
- Django Step by Step 1.0.2新版
- [Python]Django Step by Step 笔记(二)
- Django-step-by-step中的错误(python2.6+Django1.1+pyDev+eclipse)
- [Machine Learning step by step][By jy]2.2.1 统计学习:scikit-learn库的设置和估计器对象
- Django Step by Step 2010版(基于Django 1.1.1) 第五讲
- step by step设置postgresql用户密码并配置远程连接
- [Python]Django Step by Step 笔记(三)
- [学习] Apache + mod_python + Django Step by Step
- 转载:iptables入门教程--设置静态防火墙( step by step)
- step by step django 入门
- iptables入门教程--设置静态防火墙( step by step)
- Django Step by Step
- SAP登陆组设置Step by step.
- 开始学习 limodou 的 Django step by step 了
- iptables入门教程--设置静态防火墙( step by step)
- 开始学习 limodou 的 Django step by step 了
- django step by step