django是mtv框架
models,templates,viewspython
如下是url傳遞參數樣例django
http://192.168.10.103:9008/login/?user=alex&passwd=123session
easy_install pip pip install django easy_install django 以上兩種方法安裝的django版本是不同的 >>> import django >>> django.__version__ '1.10rc1' django-admin startproject first cd first/first 如下是項目(project)目錄結構 [root@103-c7 first]# ll total 28 -rw-rw-r-- 1 root root 0 Jul 21 12:42 __init__.py -rw-r--r-- 1 root root 121 Jul 21 12:47 __init__.pyc -rw-rw-r-- 1 root root 3240 Jul 21 18:49 settings.py -rw-r--r-- 1 root root 2624 Jul 21 18:50 settings.pyc -rw-rw-r-- 1 root root 900 Jul 21 19:38 urls.py -rw-r--r-- 1 root root 1099 Jul 21 19:38 urls.pyc -rw-rw-r-- 1 root root 387 Jul 21 12:42 wsgi.py -rw-r--r-- 1 root root 574 Jul 21 12:48 wsgi.pyc python manage.py startapp blog 如下是應用(app)目錄結構 [root@103-c7 first]# cd blog/ [root@103-c7 blog]# ll total 40 -rw-rw-r-- 1 root root 63 Jul 21 12:43 admin.py -rw-r--r-- 1 root root 177 Jul 21 12:47 admin.pyc -rw-rw-r-- 1 root root 124 Jul 21 12:43 apps.py -rw-rw-r-- 1 root root 0 Jul 21 12:43 __init__.py -rw-r--r-- 1 root root 120 Jul 21 12:47 __init__.pyc drwxr-xr-x 2 root root 155 Jul 21 19:15 migrations -rw-rw-r-- 1 root root 261 Jul 21 19:13 models.py -rw-r--r-- 1 root root 598 Jul 21 19:13 models.pyc -rw-rw-r-- 1 root root 60 Jul 21 12:43 tests.py -rw-r--r-- 1 root root 177 Jul 21 18:50 tests.pyc -rw-rw-r-- 1 root root 571 Jul 21 19:53 views.py -rw-r--r-- 1 root root 1128 Jul 21 19:53 views.pyc 先改settings.py,加入應用名即blog INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'blog', ] 而後就能夠啓動了 python manage.py runserver 0.0.0.0:9008 &