{"title":"Conas a imscaradh le WSGI","version":"6.0","locale":"ga","docname":"howto/deployment/wsgi/index","url":"/ga/6.0/howto/deployment/wsgi/","canonical":"https://djangodocs.dev/ga/6.0/howto/deployment/wsgi/","summary":"Is é príomh-ardán imscartha Django ná WSGI, caighdeán Python le haghaidh freastalaithe gréasáin agus feidhmchláir.","html":"<h1>Conas a imscaradh le WSGI<a class=\"heading-anchor\" href=\"#how-to-deploy-with-wsgi\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>Is é príomh-ardán imscartha Django ná <a class=\"reference external\" href=\"https://wsgi.readthedocs.io/en/latest/\">WSGI</a>, caighdeán Python le haghaidh freastalaithe gréasáin agus feidhmchláir.</p>\n<p>Leagann ordú bainistíochta Django's <a class=\"reference internal\" href=\"/ga/6.0/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">startproject</code></a> cumraíocht réamhshocraithe WSGI ar bun duit, ar féidir leat a athrú de réir mar is gá do do thionscadal, agus aon fhreastalaí feidhmchláir a chomhlíonann WSGI a threorú chun é a úsáid.</p>\n<p>Cuimsíonn Django cáipéisíocht tosaithe do na freastalaithe WSGI seo a leanas:</p>\n<div class=\"toctree-wrapper compound\">\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/ga/6.0/howto/deployment/wsgi/gunicorn/\">Conas Django a úsáid le Gunicorn</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/ga/6.0/howto/deployment/wsgi/uwsgi/\">Conas Django a úsáid le UWSgi</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/ga/6.0/howto/deployment/wsgi/modwsgi/\">Conas Django a úsáid le Apache agus <code class=\"docutils literal notranslate\">mod_wsgi</code></a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/ga/6.0/howto/deployment/wsgi/apache-auth/\">Conas fíordheimhniú i gcoinne bunachar sonraí úsáideoirí Django ó Apache</a></li>\n</ul>\n</div>\n<section id=\"the-application-object\">\n<h2>An réad <code class=\"docutils literal notranslate\">`iarrat</code><a class=\"heading-anchor\" href=\"#the-application-object\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Is é an príomhchoincheap a bhaineann le húsáid le WSGI an <code class=\"docutils literal notranslate\">feidhmchláir ``is féidir a ghlaoch a úsáideann an freastalaí feidhmchláir chun cumarsáid a dhéanamh le do chód. Cuirtear é ar fáil go coitianta mar réad darb ainm ``feidhmchlár</code> i modúl Python atá inrochtana don fhreastalaí.</p>\n<p>&lt;project_name&gt;Cruthaíonn an t-ordú: DjaDmin: startproject comhad: /wsgi.py ina bhfuil feidhmchlár ``` `` `` `` `` `` `` <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">`</span></a>ghlaoch.</p>\n<p>Úsáideann freastalaí forbartha Django é agus in imscaradh WSGI táirgeachta.</p>\n<p>Faigheann freastalaithe WSGI an cosán chuig an <code class=\"docutils literal notranslate\">feidhmchlár ``is féidir a ghlaoch óna gcumraíocht. Léann freastalaí ionsuite Django, eadhon an t-ordú:djadmin: `runserver`, é ón socrú: setting: `WSGI_APPLICATION`. &lt;project_name&gt;De réir réamhshocraithe, tá sé socraithe go ``&lt;project_name&gt;.wsgi.application</code>, a thugann in iúl don <code class=\"docutils literal notranslate\">feidhmchlár</code> is féidir glaoch in:file: /wsgi.py.</p>\n</section>\n<section id=\"configuring-the-settings-module\">\n<h2>An modúl socruithe a chumrú<a class=\"heading-anchor\" href=\"#configuring-the-settings-module\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Nuair a luchtaíonn freastalaí WSGI d'iarratas, ní mór do Django an modúl socruithe a iompórtáil - sin an áit a sainmhínítear d'fheidhmchlár iomlán.</p>\n<p>Úsáideann Django athróg timpeallachta: envvar: DJANGO_SETTINGS_MODULE chun an modúl socruithe cuí a aimsiú. Caithfidh an cosán poncanach chuig an modúl socruithe a bheith ann. Is féidir leat luach difriúil a úsáid le haghaidh forbartha agus táirgeachta; braitheann sé ar fad ar an gcaoi a n-eagraíonn tú do shocruithe.</p>\n<p>Mura bhfuil an t-athróg seo socraithe, socraíonn an réamhshocraithe:file: wsgi.py é go mysite.settings`, áit a bhfuil mysite` ainm do thionscadail. Sin mar a aimsíonn: djadmin: runserver an comhad socruithe réamhshocraithe de réir réamhshocraithe.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Note</p>\n<p>Ós rud é go bhfuil athróga comhshaoil ar fud an phróisis, ní oibríonn sé seo nuair a reáchtáil tú suíomhanna iolracha Django sa phróiseas cé Tarlaíonn sé seo le mod_wsgi.</p>\n<p>Chun an fhadhb seo a sheachaint, bain úsáid as mod_wsgi mod_wsgi le gach suíomh ina phróiseas daemon féin, nó athsháraigh an luach ón timpeallacht trí <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">``</span></a>os.environ [&quot;DJANGO_SETTINGS_MODULE&quot;] = “mysite.settings&quot;` i d:file: wsgi.py a chur i bhfeidhm.</p>\n</aside>\n</section>\n<section id=\"applying-wsgi-middleware\">\n<h2>Middleware WSGI a chur i bhfeidhm<a class=\"heading-anchor\" href=\"#applying-wsgi-middleware\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>&lt;3333 #middleware -components-that-play-both-sides&gt;Chun iarratas a dhéanamh: pep: Middleware WSGI is féidir leat an réad feidhmchláir a fhilleadh. Mar shampla d'fhéadfá na línte seo a chur leis ag bun de:file: wsgi.py:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">helloworld.wsgi</span> <span class=\"kn\">import</span> HelloWorldApplication\n\napplication <span class=\"o\">=</span> HelloWorldApplication<span class=\"p\">(</span>application<span class=\"p\">)</span>\n</code></pre></div>\n<p>D'fhéadfá feidhmchlár saincheaptha WSGI a chur in ionad feidhmchlár Django WSGI a thosclaíonn chuig feidhmchlár Django WSGI níos déanaí, más mian leat feidhmchlár Django a chomhcheangal le feidhmchlár WSGI de chreat eile.</p>\n</section>","rootId":"how-to-deploy-with-wsgi","toc":[{"title":"An réad `iarrat","anchor":"the-application-object","children":[]},{"title":"An modúl socruithe a chumrú","anchor":"configuring-the-settings-module","children":[]},{"title":"Middleware WSGI a chur i bhfeidhm","anchor":"applying-wsgi-middleware","children":[]}],"breadcrumbs":[{"docname":"howto/index","title":"Treoracha conas","url":"/ga/6.0/howto/"},{"docname":"howto/deployment/index","title":"Conas Django a imscaradh","url":"/ga/6.0/howto/deployment/"}],"prev":{"docname":"howto/deployment/index","title":"Conas Django a imscaradh","url":"/ga/6.0/howto/deployment/"},"next":{"docname":"howto/deployment/wsgi/gunicorn","title":"Conas Django a úsáid le Gunicorn","url":"/ga/6.0/howto/deployment/wsgi/gunicorn/"},"formats":{"html":"/ga/6.0/howto/deployment/wsgi/","markdown":"/ga/6.0/howto/deployment/wsgi.md","json":"/ga/6.0/howto/deployment/wsgi.json"},"source":"https://github.com/django/django/blob/stable/6.0.x/docs/howto/deployment/wsgi/index.txt","official":"https://docs.djangoproject.com/ga/6.0/howto/deployment/wsgi/","inVersions":["6.1","6.0","5.2"],"inLocales":["en","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}