python+django web開發環境搭建

來源:互聯網
上載者:User
下載python-2.7.2.msi http://www.python.org/getit/

Django-1.3.1.tar.gz   https://www.djangoproject.com/

Django暫時只支援python 2.4 ~ 2.7, 在Django-1.3.1\docs\intro\install.txt中有說明: Being a Python Web framework, Django requires Python. It works with any Python
version from 2.4 to 2.7 (due to backwards
incompatibilities in Python 3.0, Django does not currently work with
Python 3.0;安裝python-2.7.2,並添加環境變數D:\Python27;D:\Python27\Scripts;命令列進入Django-1.3.1目錄, 安裝djangopython setup.py installDjango提供了tutorialDjango-1.3.1\docs\intro建立網站E:\python>django-admin.py startproject mysite啟動django內建的web伺服器E:\python>cd mysiteE:\python\mysite>manage.py runserver
Validating models...

0 errors found
Django version 1.3.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.在瀏覽器中輸入 http://127.0.0.1:8000/ 瀏覽頁面ps:在windows7中按上述步驟配置好後,出現下列情況
D:\work\python>django-admin.py startproject mysite
Usage: django-admin.py subcommand [options] [args]
...
很顯然django-admin.py不參識別startproject命令,其它命令也不能識別。不過,另一種方式卻可以D:\Python27\Scripts>python django-admin.py startproject mysite
這說明django-admin.py 後面的參數不能傳遞進去,可以通過修改註冊表實現。輸入regedit, 進入 HKEY_CLASSES_ROOT\py_auto_file\shell\open\command , "C:\Python26\python.exe"
"%1" change it to "C:\Python26\python.exe" "%1" %*成功解決了

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.