index.rst
This file
Path
docs/deploying/index.rst
78 lines · 3.1 KiB
Last changed by
Merge branch 'stable'David Lordbefore adoption798e006
History of this fileTake it
1Deploying to Production2=======================34After developing your application, you'll want to make it available5publicly to other users. When you're developing locally, you're probably6using the built-in development server, debugger, and reloader. These7should not be used in production. Instead, you should use a dedicated8WSGI server or hosting platform, some of which will be described here.910"Production" means "not development", which applies whether you're11serving your application publicly to millions of users or privately /12locally to a single user. **Do not use the development server when13deploying to production. It is intended for use only during local14development. It is not designed to be particularly secure, stable, or15efficient.**1617Self-Hosted Options18-------------------1920Flask is a WSGI *application*. A WSGI *server* is used to run the21application, converting incoming HTTP requests to the standard WSGI22environ, and converting outgoing WSGI responses to HTTP responses.2324The primary goal of these docs is to familiarize you with the concepts25involved in running a WSGI application using a production WSGI server26and HTTP server. There are many WSGI servers and HTTP servers, with many27configuration possibilities. The pages below discuss the most common28servers, and show the basics of running each one. The next section29discusses platforms that can manage this for you.3031.. toctree::32 :maxdepth: 13334 gunicorn35 waitress36 mod_wsgi37 uwsgi38 gevent39 asgi4041WSGI servers have HTTP servers built-in. However, a dedicated HTTP42server may be safer, more efficient, or more capable. Putting an HTTP43server in front of the WSGI server is called a "reverse proxy."4445.. toctree::46 :maxdepth: 14748 proxy_fix49 nginx50 apache-httpd5152This list is not exhaustive, and you should evaluate these and other53servers based on your application's needs. Different servers will have54different capabilities, configuration, and support.555657Hosting Platforms58-----------------5960There are many services available for hosting web applications without61needing to maintain your own server, networking, domain, etc. Some62services may have a free tier up to a certain time or bandwidth. Many of63these services use one of the WSGI servers described above, or a similar64interface. The links below are for some of the most common platforms,65which have instructions for Flask, WSGI, or Python.6667- `PythonAnywhere <https://help.pythonanywhere.com/pages/Flask/>`_68- `Google App Engine <https://cloud.google.com/appengine/docs/standard/python3/building-app>`_69- `Google Cloud Run <https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service>`_70- `AWS Elastic Beanstalk <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html>`_71- `Microsoft Azure <https://docs.microsoft.com/en-us/azure/app-service/quickstart-python>`_7273This list is not exhaustive, and you should evaluate these and other74services based on your application's needs. Different services will have75different capabilities, configuration, pricing, and support.7677You'll probably need to :doc:`proxy_fix` when using most hosting78platforms.