{"title":"Conas a imscaradh le WSGI","version":"5.2","locale":"ga","docname":"howto/deployment/wsgi/index","url":"/ga/5.2/howto/deployment/wsgi/","canonical":"https://djangodocs.dev/ga/5.2/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. Leagann ordú bainistíochta Django's startproject…","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/5.2/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">startproject</span></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/5.2/howto/deployment/wsgi/gunicorn/\">Conas Django a úsáid le Gunicorn</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/ga/5.2/howto/deployment/wsgi/uwsgi/\">Conas Django a úsáid le UWSgi</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/ga/5.2/howto/deployment/wsgi/modwsgi/\">Conas Django a úsáid le Apache agus <code class=\"docutils literal notranslate\"><span class=\"pre\">mod_wsgi</span></code></a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/ga/5.2/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\"><span class=\"pre\">`iarrat</span></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\"><span class=\"pre\">feidhmchláir</span> <span class=\"pre\">``is</span> <span class=\"pre\">féidir</span> <span class=\"pre\">a</span> <span class=\"pre\">ghlaoch</span> <span class=\"pre\">a</span> <span class=\"pre\">úsáideann</span> <span class=\"pre\">an</span> <span class=\"pre\">freastalaí</span> <span class=\"pre\">feidhmchláir</span> <span class=\"pre\">chun</span> <span class=\"pre\">cumarsáid</span> <span class=\"pre\">a</span> <span class=\"pre\">dhéanamh</span> <span class=\"pre\">le</span> <span class=\"pre\">do</span> <span class=\"pre\">chód.</span> <span class=\"pre\">Cuirtear</span> <span class=\"pre\">é</span> <span class=\"pre\">ar</span> <span class=\"pre\">fáil</span> <span class=\"pre\">go</span> <span class=\"pre\">coitianta</span> <span class=\"pre\">mar</span> <span class=\"pre\">réad</span> <span class=\"pre\">darb</span> <span class=\"pre\">ainm</span> <span class=\"pre\">``feidhmchlár</span></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\"><span class=\"pre\">feidhmchlár</span> <span class=\"pre\">``is</span> <span class=\"pre\">féidir</span> <span class=\"pre\">a</span> <span class=\"pre\">ghlaoch</span> <span class=\"pre\">óna</span> <span class=\"pre\">gcumraíocht.</span> <span class=\"pre\">Léann</span> <span class=\"pre\">freastalaí</span> <span class=\"pre\">ionsuite</span> <span class=\"pre\">Django,</span> <span class=\"pre\">eadhon</span> <span class=\"pre\">an</span> <span class=\"pre\">t-ordú:djadmin:</span> <span class=\"pre\">`runserver`,</span> <span class=\"pre\">é</span> <span class=\"pre\">ón</span> <span class=\"pre\">socrú:</span> <span class=\"pre\">setting:</span> <span class=\"pre\">`WSGI_APPLICATION`.</span> <span class=\"pre\">&lt;project_name&gt;De</span> <span class=\"pre\">réir</span> <span class=\"pre\">réamhshocraithe,</span> <span class=\"pre\">tá</span> <span class=\"pre\">sé</span> <span class=\"pre\">socraithe</span> <span class=\"pre\">go</span> <span class=\"pre\">``&lt;project_name&gt;.wsgi.application</span></code>, a thugann in iúl don <code class=\"docutils literal notranslate\"><span class=\"pre\">feidhmchlár</span></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=\"w\"> </span><span class=\"nn\">helloworld.wsgi</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">HelloWorldApplication</span>\n\n<span class=\"n\">application</span> <span class=\"o\">=</span> <span class=\"n\">HelloWorldApplication</span><span class=\"p\">(</span><span class=\"n\">application</span><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/5.2/howto/"},{"docname":"howto/deployment/index","title":"Conas Django a imscaradh","url":"/ga/5.2/howto/deployment/"}],"prev":{"docname":"howto/deployment/index","title":"Conas Django a imscaradh","url":"/ga/5.2/howto/deployment/"},"next":{"docname":"howto/deployment/wsgi/gunicorn","title":"Conas Django a úsáid le Gunicorn","url":"/ga/5.2/howto/deployment/wsgi/gunicorn/"},"formats":{"html":"/ga/5.2/howto/deployment/wsgi/","markdown":"/ga/5.2/howto/deployment/wsgi.md","json":"/ga/5.2/howto/deployment/wsgi.json"},"source":"https://github.com/django/django/blob/stable/5.2.x/docs/howto/deployment/wsgi/index.txt","official":"https://docs.djangoproject.com/ga/5.2/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"]}