安装:
tar -zxvf Django-1.5.1.tar.gz
cd Django-1.5.1
[root@likun Django-1.5.1]# ls
[root@likun Django-1.5.1]# python setup.py install
查看版本
>>> import django
>>> django.VERSION
(1, 5, 1, 'final', 0)
创建一个project
[root@likun ~]# mkdir django_proj
[root@likun ~]# cd django_proj/
[root@likun django_proj]# django-admin.py startproject testweb
[root@likun django_proj]# ls
testweb
一个project可以有多个app,创建一个app,并启动
[root@likun django_proj]# ls
testweb
[root@likun django_proj]# cd testweb/
[root@likun testweb]# ls
manage.py testweb
[root@likun testweb]# ./manage.py startapp app01
[root@likun testweb]# ls
app01 manage.py testweb
[root@likun testweb]# ./manage.py runserver 0.0.0.0:8001
Validating models...
0 errors found
September 22, 2014 - 11:00:01
Django version 1.5.1, using settings 'testweb.settings'
Development server is running at http://0.0.0.0:8001/
Quit the server with CONTROL-C.
[22/Sep/2014 11:00:52] "GET / HTTP/1.1" 200 1958
基本框架出来了,虽然恶心了点,不过架子起来了就好办了
附件列表