Django--入門篇:下載與項目產生,django--入門篇

來源:互聯網
上載者:User

Django--入門篇:下載與項目產生,django--入門篇

django作為python web應用開發最火的架構,沒有之一,今天就給大家介紹django的一些入門知識。

我們選擇pycharm工具,首先得要有django

1.下載django

  --pip install django==1* 

  --python -m pip install django==1*(第一個如果下載失敗,試試第二個)

2.建立django項目

  --我們選擇在工作域下D:\pyspace\web輸入cmd命令直接跳到該目錄

  --dos命令下輸入:django-admin startproject  myproject

  產生

  

3.使用cd myproject命令,進入到項目中(如),運行項目

  --python manage.py runserver

  運行後會出現:Django version 1.11.11, using settings 'blog.settings' 

          Starting development server at http://127.0.0.1:8000/

          Quit the server with CTRL-BREAK.(預設伺服器位址:http://127.0..0.1:8000/)

  同時還會產生

4.在瀏覽器輸入http://127.0.0.1:8000/(或者使用localhost:8000)訪問項目

 

5.建立應用

  --python manage.py startapp myhome(myhome是定義的應用程式名稱)

  此時會出現

    myhome檔案夾下是

 

 下一篇會給大家介紹項目中demo的編寫和設計模式(‘MVT’)。

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.