{"title":"Como usar o Django com o Gunicorn","version":"4.0","locale":"pt-br","docname":"howto/deployment/wsgi/gunicorn","url":"/pt-br/4.0/howto/deployment/wsgi/gunicorn/","canonical":"https://djangodocs.dev/pt-br/4.0/howto/deployment/wsgi/gunicorn/","summary":"Gunicorn (‘Green Unicorn’) is a pure-Python WSGI server for UNIX. It has no dependencies and can be installed using pip . Instalando o Gunicorn Link para este…","html":"<h1>Como usar o Django com o Gunicorn<a class=\"heading-anchor\" href=\"#how-to-use-django-with-gunicorn\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><a class=\"reference external\" href=\"https://gunicorn.org/\">Gunicorn</a> (‘Green Unicorn’) is a pure-Python WSGI server for UNIX. It has no\ndependencies and can be installed using <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code>.</p>\n<section id=\"installing-gunicorn\">\n<h2>Instalando o Gunicorn<a class=\"heading-anchor\" href=\"#installing-gunicorn\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Install gunicorn by running <code class=\"docutils literal notranslate\"><span class=\"pre\">python</span> <span class=\"pre\">-m</span> <span class=\"pre\">pip</span> <span class=\"pre\">install</span> <span class=\"pre\">gunicorn</span></code>. For more\ndetails, see the <a class=\"reference external\" href=\"https://docs.gunicorn.org/en/latest/install.html\">gunicorn documentation</a>.</p>\n</section>\n<section id=\"running-django-in-gunicorn-as-a-generic-wsgi-application\">\n<h2>Rodando Django em Gunicorn como  uma aplicação WSGI genérica.<a class=\"heading-anchor\" href=\"#running-django-in-gunicorn-as-a-generic-wsgi-application\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>When Gunicorn is installed, a <code class=\"docutils literal notranslate\"><span class=\"pre\">gunicorn</span></code> command is available which starts\nthe Gunicorn server process. The simplest invocation of gunicorn is to pass the\nlocation of a module containing a WSGI application object named\n<code class=\"docutils literal notranslate\"><span class=\"pre\">application</span></code>, which for a typical Django project would look like:</p>\n<div class=\"code-block\" data-language=\"bash\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</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=\"Shell code\"><code>gunicorn<span class=\"w\"> </span>myproject.wsgi\n</code></pre></div>\n<p>Isso irá iniciar um processo de uma thread escutando na <code class=\"docutils literal notranslate\"><span class=\"pre\">127.0.0.1:8000</span></code>. Isso requer que seu projeto esteja no path Python; a maneira mais simples de verificar isso é rodar este comando do memso diretório que seu arquivo <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code></p>\n<p>Veja  <a class=\"reference external\" href=\"https://docs.gunicorn.org/en/latest/deploy.html\">deployment documentation</a>  do Gunicorn para dicas adicionais</p>\n</section>","rootId":"how-to-use-django-with-gunicorn","toc":[{"title":"Instalando o Gunicorn","anchor":"installing-gunicorn","children":[]},{"title":"Rodando Django em Gunicorn como  uma aplicação WSGI genérica.","anchor":"running-django-in-gunicorn-as-a-generic-wsgi-application","children":[]}],"breadcrumbs":[{"docname":"howto/index","title":"Guias de “como fazer”","url":"/pt-br/4.0/howto/"},{"docname":"howto/deployment/index","title":"How to deploy Django","url":"/pt-br/4.0/howto/deployment/"},{"docname":"howto/deployment/wsgi/index","title":"Como implementar com WSGI","url":"/pt-br/4.0/howto/deployment/wsgi/"}],"prev":{"docname":"howto/deployment/wsgi/index","title":"Como implementar com WSGI","url":"/pt-br/4.0/howto/deployment/wsgi/"},"next":{"docname":"howto/deployment/wsgi/uwsgi","title":"Como usar Django com uWSGI","url":"/pt-br/4.0/howto/deployment/wsgi/uwsgi/"},"formats":{"html":"/pt-br/4.0/howto/deployment/wsgi/gunicorn/","markdown":"/pt-br/4.0/howto/deployment/wsgi/gunicorn.md","json":"/pt-br/4.0/howto/deployment/wsgi/gunicorn.json"},"source":"https://github.com/django/django/blob/stable/4.0.x/docs/howto/deployment/wsgi/gunicorn.txt","official":"https://docs.djangoproject.com/pt-br/4.0/howto/deployment/wsgi/gunicorn/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}