{"title":"How to deploy Django","version":"4.2","locale":"pt-br","docname":"howto/deployment/index","url":"/pt-br/4.2/howto/deployment/","canonical":"https://djangodocs.dev/pt-br/4.2/howto/deployment/","summary":"Django is full of shortcuts to make web developers’ lives easier, but all those tools are of no use if you can’t easily deploy your sites. Since Django’s inception,…","html":"<h1>How to deploy Django<a class=\"heading-anchor\" href=\"#how-to-deploy-django\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>Django is full of shortcuts to make web developers’ lives easier, but all\nthose tools are of no use if you can’t easily deploy your sites. Since Django’s\ninception, ease of deployment has been a major goal.</p>\n<p>There are many options for deploying your Django application, based on your\narchitecture or your particular business needs, but that discussion is outside\nthe scope of what Django can give you as guidance.</p>\n<p>Django, being a web framework, needs a web server in order to operate. And\nsince most web servers don’t natively speak Python, we need an interface to\nmake that communication happen.</p>\n<p>Django currently supports two interfaces: WSGI and ASGI.</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference external\" href=\"https://wsgi.readthedocs.io/en/latest/\">WSGI</a> is the main Python standard for communicating between web servers and\napplications, but it only supports synchronous code.</p></li>\n<li><p><a class=\"reference external\" href=\"https://asgi.readthedocs.io/en/latest/\">ASGI</a> is the new, asynchronous-friendly standard that will allow your\nDjango site to use asynchronous Python features, and asynchronous Django\nfeatures as they are developed.</p></li>\n</ul>\n<p>You should also consider how you will handle <a class=\"reference internal\" href=\"/pt-br/4.2/howto/static-files/deployment/\"><span class=\"doc\">static files</span></a> for your application, and how to handle\n<a class=\"reference internal\" href=\"/pt-br/4.2/howto/error-reporting/\"><span class=\"doc\">error reporting</span></a>.</p>\n<p>Finally, before you deploy your application to production, you should run\nthrough our <a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/\"><span class=\"doc\">deployment checklist</span></a> to ensure that your\nconfigurations are suitable.</p>\n<div class=\"toctree-wrapper compound\">\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/\">Como implementar com WSGI</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/gunicorn/\">Como usar o Django com o Gunicorn</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/uwsgi/\">Como usar Django com uWSGI</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/modwsgi/\">Como usar o Django com Apache e <code class=\"docutils literal notranslate\"><span class=\"pre\">mod_wsgi</span></code></a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/apache-auth/\">How to authenticate against Django’s user database from Apache</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/#the-application-object\">O objeto <code class=\"docutils literal notranslate\"><span class=\"pre\">Application</span></code></a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/#configuring-the-settings-module\">Configurando o módulo de definições.</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/wsgi/#applying-wsgi-middleware\">Aplicando o middleware WSGI</a></li>\n</ul>\n</li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/asgi/\">Como fazer o deploy com ASGI</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/asgi/daphne/\">How to use Django with Daphne</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/asgi/hypercorn/\">How to use Django with Hypercorn</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/asgi/uvicorn/\">How to use Django with Uvicorn</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/asgi/#the-application-object\">O objeto <code class=\"docutils literal notranslate\"><span class=\"pre\">Application</span></code></a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/asgi/#configuring-the-settings-module\">Configurando o módulo de definições.</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/asgi/#applying-asgi-middleware\">Applying ASGI middleware</a></li>\n</ul>\n</li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/\">Lista de verificação para distribuição</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/#run-manage-py-check-deploy\">Execute <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span> <span class=\"pre\">check</span> <span class=\"pre\">--deploy</span></code></a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/#critical-settings\">Configurações críticas.</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/#environment-specific-settings\">Configurações específicas de configurações</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/#https\">HTTPS</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/#performance-optimizations\">Otimizações de desempenho.</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"/pt-br/4.2/howto/deployment/checklist/#error-reporting\">Relatório de erro</a></li>\n</ul>\n</li>\n</ul>\n</div>","rootId":"how-to-deploy-django","toc":[],"breadcrumbs":[{"docname":"howto/index","title":"Guias de “como fazer”","url":"/pt-br/4.2/howto/"}],"prev":{"docname":"howto/custom-file-storage","title":"Como escrever uma classe de armazenamento customizada","url":"/pt-br/4.2/howto/custom-file-storage/"},"next":{"docname":"howto/deployment/wsgi/index","title":"Como implementar com WSGI","url":"/pt-br/4.2/howto/deployment/wsgi/"},"formats":{"html":"/pt-br/4.2/howto/deployment/","markdown":"/pt-br/4.2/howto/deployment.md","json":"/pt-br/4.2/howto/deployment.json"},"source":"https://github.com/django/django/blob/stable/4.2.x/docs/howto/deployment/index.txt","official":"https://docs.djangoproject.com/pt-br/4.2/howto/deployment/","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"]}