Puas yog lub raj mis siv nginx?
Puas yog lub raj mis siv nginx?

Video: Puas yog lub raj mis siv nginx?

Video: Puas yog lub raj mis siv nginx?
Video: Puas yog luag dag koj xwb | Kawm muas 2024, Kaum ib hlis
Anonim

Flask yog lub teeb yuag Python lub vev xaib, thiab nginx ua yog lub web server ruaj khov, uas ua haujlwm zoo ntawm cov khoom siv pheej yig. Hauv tsab xov xwm no kuv yuav qhia koj txog cov txheej txheem ntawm kev txhim kho thiab teeb tsa nginx ua server rau host Flask raws li kev siv.

Hais txog qhov no, lub khob puas xav tau nginx?

Yog koj xav khiav Flask hauv kev tsim khoom, nco ntsoov siv lub vev xaib npaj tsim khoom zoo li Nginx , thiab cia koj lub app ua haujlwm los ntawm WSGI daim ntawv thov server zoo li Gunicorn. Yog tias koj npaj yuav ua haujlwm ntawm Heroku, lub vev xaib server raug muab implicitly.

Ib sab saum toj, dab tsi Web server yog flask? Werkzeug yog lub neej ntawd WSGI neeg rau zaub mov rau cov ntawv thov dej cawv tab sis hauv kev tsim khoom koj yuav tsum siv cov servers paub tab zoo li Gunicorn khiav Flask Applications.

Ib yam li ntawd, lub raj mis puas zoo rau kev txhim kho lub vev xaib?

Teb Chaws Asmeskas: Vim li cas peb yuav tsum siv Flask rau kev txhim kho lub vev xaib ? Flask yog lub teeb hnyav dua rau Python. Nws yog ib qho cuab yeej los tsim cov vev xaib sai dua. Nws tsis tas yuav, lub moj khaum yeej tsis yog, tab sis nws ua kev loj hlob sai dua los ntawm kev muab cov lej rau txhua yam txheej txheem xws li kev sib cuam tshuam hauv cov ntaub ntawv lossis cov haujlwm ua haujlwm.

Puas yog WSGI server?

Flask yog qhov zoo heev micro web moj khaum rau Python, txawm li cas los xij, nws tsis yog hom lus hauv web. Yog li kom tau txais peb Python code khiav ntawm lub vev xaib server yog dag. Apache yuav siv WSGI ntaub ntawv nkag mus rau peb Flask application, yog li ntawd WSGI cov ntaub ntawv tso cai Apache cuam tshuam nrog Python zoo li nws yog haiv neeg. Nws yog ib tsab ntawv yooj yim.

Pom zoo: