參考 https://docs.djangoproject.com/en/dev/intro/tutorial01/ ~ /tutorial04/
Install:
sudo apt-get update sudo apt-get upgrade sudo apt-get install python-setuptools sudo apt-get install python-pip sudo pip install django
Create a project:
cd //var/www/ sudo django-admin.py startproject mutarock
資料夾hello長的像這樣~~
mutarock/ manage.py mutarock/ __init__.py settings.py urls.py wsgi.py
- 各別檔案和資料夾的敘述請見(連結)
確認一下django的server是否正確:
python manage.py runserver如果沒有問題的話,應該就可以看到
----------------------------------------------------------------
Validating models...
0 errors found.
Django version 1.4, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
----------------------------------------------------------------
打開瀏覽器
http://127.0.0.1:8000
可以看到預設的頁面
No comments:
Post a Comment