Cov txheej txheem:

MODERN VENDING TSHUAB GUI Siv RASPBERRY PI Nrog DJANGO: 4 Cov Kauj Ruam
MODERN VENDING TSHUAB GUI Siv RASPBERRY PI Nrog DJANGO: 4 Cov Kauj Ruam

Video: MODERN VENDING TSHUAB GUI Siv RASPBERRY PI Nrog DJANGO: 4 Cov Kauj Ruam

Video: MODERN VENDING TSHUAB GUI Siv RASPBERRY PI Nrog DJANGO: 4 Cov Kauj Ruam
Video: AFen Vending Machine Manufacturer 2024, Hlis ntuj nqeg
Anonim
MODERN VENDING TSHUAB GUI Siv RASPBERRY PI Nrog DJANGO
MODERN VENDING TSHUAB GUI Siv RASPBERRY PI Nrog DJANGO

Peb puas tuaj yeem tsim GUI niaj hnub siv cov lus hauv web rau lub tshuab muag?

Cov lus teb rau saum toj no yog peb ua tau. Peb tuaj yeem siv cov tshuab muag khoom siv hom kiosk. Qhov tswv yim hauv qab no kuv twb tau thov ntawm kuv qhov haujlwm uas twb muaj lawm thiab nws ua haujlwm tau zoo thiab peb tau sim ntau yam. Koj tseem tuaj yeem ua kom zoo saib GUI niaj hnub kev paub tam sim no ntawm css thiab HTML, JavaScript.

Khoom siv

Yam yuavtsum tau kawm uantej hauv qab no yog xav tau:

  1. Raspberry pi Nrog raspian OS teeb tsa hauv nws
  2. Lub Touchscreen zaub tau tshaj nrog raspberry pi
  3. Kev paub me ntsis txog qhov pib ntawm cov lus hauv web (CSS, HTML, JavaScript)

Kauj Ruam 1: Txhim Kho Django thiab Ua Ntej Ua Ntej rau Project

  1. hloov kho Python 2 mus rau 3 uas siv lub davhlau ya nyob twg. Koj tuaj yeem hla cov kauj ruam hauv Video.
  2. Nruab Django ntawm Raspberry pi siv Pip hais kom ua hauv kab davhlau ya nyob twg.
  3. (tsis teb los tau) Txhim kho cov tsev qiv ntawv xav tau rau kov cov lus. Kev ua no mus txog koj li Chaw tsim khoom lub vev xaib.

Kauj Ruam 2: Teeb Koj Daim Ntawv Thov Django

Teeb Koj Daim Ntawv Thov Django
Teeb Koj Daim Ntawv Thov Django
Teeb Koj Daim Ntawv Thov Django
Teeb Koj Daim Ntawv Thov Django

Yog tias koj nyiam nrog IDE ntawm raspberry pi mus rau nws tab sis kuv pom zoo kom ua Django daim ntawv thov hauv PC. Mus rau Pycharm thiab tsim txoj haujlwm tshiab hauv qab Qhov Xaiv Django. Muab lub npe tshiab rau txoj haujlwm thiab ntawm Enable Template thiab tsim lub npe rau koj lub app thiab yog tias koj tab tom ua haujlwm ntawm cov chaw khaws ntaub ntawv tso cai Django admin thiab nias pib.

  • Txheeb xyuas server ua haujlwm lossis tsis siv qhov hais kom ua - sej tswj.py runerver ntawm davhlau ya nyob twg
  • Yog tias Koj Tsis Paub Txog Django cov hauv paus nkag mus rau lub xaib Polls app uas koj tuaj yeem nkag siab yooj yim txog Django Basics.

Kauj Ruam 3: Tsim GUI thiab Txuas Nrog Backend

  • Txog Kev Tsim GUI Kuv Yuav Ua tiav nrog Html 5 thiab CSS 3. Koj tuaj yeem tsim tus lej ntawm nplooj ntawv raws li koj xav tau thiab rau Icons thiab cov duab sim rub tawm thiab siv yog tias koj tab tom ua haujlwm nrog lub tshuab muag khoom offline thiab rau online siv URL txuas. Kuv tau khaws cov.html cov ntaub ntawv hauv Cov Ntawv Teev Npe peb nyuam qhuav qhib.
  • Siv cov ntawv zoo li qub khaws cia Cov Duab, Yeeb yaj duab thiab CSS cov ntaub ntawv feem
  • Tom qab ntawd siv urls.py hauv Django los txuas Cov Ntaub Ntawv nrog kev rov ua tiav kawg.

(lossis)

clone lossis rub tawm lub chaw cia khoom hauv GitHub-Raspberry-pi-Gui-Django

Kauj Ruam 4: Hloov Cov Ntaub Ntawv hauv Raspberry-pi thiab teeb tsa

Hloov Cov Ntaub Ntawv hauv Raspberry-pi thiab Kho
Hloov Cov Ntaub Ntawv hauv Raspberry-pi thiab Kho
Hloov Cov Ntaub Ntawv hauv Raspberry-pi thiab Kho
Hloov Cov Ntaub Ntawv hauv Raspberry-pi thiab Kho

Nrog koj zoo siab, Yog tias koj ua raws cov kauj ruam txog tam sim no nws yog lub sijhawm los sim GUI ntawm raspberry pi.

  1. tsim daim ntawv thov Django nrog tib lub npe zoo li siv hauv koj lub PC lossis Laptop
  2. Tsim Cov Qauv thiab Cov Ntawv Zoo Li Qub ntawm koj Pi
  3. Hloov Cov Ntaub Ntawv tshiab nrog Cov Ntaub Ntawv Tiag uas koj tsim Rau kom paub meej ntxiv xa mus rau Daim Duab.
  4. Cov kauj ruam tom ntej yog los tsim Auto-start script los pib server thaum khau raj hauv Background
  5. Qhov kawg yog ua kom Kiosk Hom nyob rau hauv raspberry pi kom paub meej ntxiv Txheeb xyuas kuv Github Page anf yog tias koj xav qhia chromium hauv Fullscreen Mode

Pom zoo: