Cov txheej txheem:

Kuv yuav tsim ib qhov project Django li cas?
Kuv yuav tsim ib qhov project Django li cas?

Video: Kuv yuav tsim ib qhov project Django li cas?

Video: Kuv yuav tsim ib qhov project Django li cas?
Video: "TSIS TXHOB" - TUPAO XIONG (Official Audio/Lyrics) 2024, Kaum ib hlis
Anonim

Cov txheej txheem yog ncaj nraim:

  1. Siv cov django ua -admin tool rau tsim tus qhov project folder, cov ntaub ntawv yooj yim templates, thiab qhov project tswj tsab ntawv (manage.py).
  2. Siv manager.py rau tsim ib lossis ntau daim ntawv thov.
  3. Sau npe cov ntawv thov tshiab kom suav nrog lawv hauv qhov project .
  4. Txuas mus rau url / path mapper rau txhua tus daim ntawv thov .

Hais txog qhov no, kuv yuav teeb tsa Django li cas?

Django tuaj yeem ntsia tau yooj yim siv pip. Hauv qhov hais kom ua, ua cov lus txib hauv qab no: pip nruab django . Qhov no yuav download tau thiab nruab Django . Tom qab lub kev teeb tsa tau ua tiav, koj tuaj yeem txheeb xyuas koj li Django installation los ntawm kev ua django ua -admin --version nyob rau hauv qhov hais kom ua.

Tsis tas li ntawd, koj tsim ib qhov project hauv Python li cas? Pure Python tej yaam num yog npaj rau Python dawb huv programming.

  1. Txhawm rau tsim ib qhov project, ua ib qho hauv qab no: Los ntawm cov ntawv qhia zaub mov tseem ceeb, xaiv Cov Ntaub Ntawv | Txoj Haujlwm Tshiab.
  2. Hauv New Project dialog, qhia lub npe qhov project thiab nws qhov chaw nyob. Cov lus sib tham yuav txawv nyob ntawm PyCharm tsab.
  3. Tom ntej no, nyem.

Raws li, Kuv yuav pib Django li cas ntawm Windows?

Ua raws li cov kauj ruam hauv qab no:

  1. Hloov mus rau Django tej yaam num folder thiab khiav cov lus txib nram qab no los tsim ib qhov project tshiab.
  2. Yog tias koj xav tsim ib daim ntawv thov tshiab hauv qhov project, ua raws li cov lus txib hauv qab no thiab.
  3. Kho cov ntaub ntawv installdir/apps/django/django_projects/PROJECT/APP/views.py thiab ntxiv cov ntsiab lus no:

Kuv yuav tsim ib qho chaw virtual hauv Django li cas?

Yuav Ua Li Cas Tsim Ib Ib puag ncig Virtual rau koj qhov project Django Siv virtualenv

  1. Kauj ruam 1: Tsim ib qho chaw tshiab virtual. Nyob ntawm Python version koj xav siv, pib los ntawm kev tsim ib puag ncig virtual.
  2. Kauj ruam 2: Txhim kho Django ntawm Virtualenv.
  3. Kauj ruam 3: Tsim Django Project tshiab ntawm Virtualenv.

Pom zoo: