index.rst
This file
Path
docs/deploying/index.rst
79 lines · 3.1 KiB
Last changed by
remove heroku linkDavid Lordbefore adoptionce6ad90
History of this fileTake it
The walk stopped after 200 commits: lines older than 4240ace point at it.
Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 1–2why, one step back1Deploying to Production2=======================Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 3why, one step back3Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 4–8why, one step back4After 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.Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 9why, one step back9Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 10–15why, one step back10"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.**Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 16why, one step back16Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 17–18why, one step back17Self-Hosted Options18-------------------Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 19why, one step back19Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 20–22why, one step back20Flask 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.Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 23why, one step back23Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 24–29why, one step back24The 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.Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 30why, one step back30Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 31–32why, one step back31.. toctree::32 :maxdepth: 1Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 33why, one step back33Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 34–45why, one step back34 gunicorn35 waitress36 mod_wsgi37 uwsgi38 gevent39 eventlet40 asgi4142WSGI servers have HTTP servers built-in. However, a dedicated HTTP43server may be safer, more efficient, or more capable. Putting an HTTP44server in front of the WSGI server is called a "reverse proxy."45Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 46why, one step back46.. toctree::Merge branch '2.1.x'David Lordbefore adoption9139af1
line 47why, one step back47 :maxdepth: 1Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption4240ace
line 48why, one step back48Merge branch '2.1.x'David Lordbefore adoption9139af1
lines 49–79why, one step back49 proxy_fix50 nginx51 apache-httpd5253This list is not exhaustive, and you should evaluate these and other54servers based on your application's needs. Different servers will have55different capabilities, configuration, and support.565758Hosting Platforms59-----------------6061There are many services available for hosting web applications without62needing to maintain your own server, networking, domain, etc. Some63services may have a free tier up to a certain time or bandwidth. Many of64these services use one of the WSGI servers described above, or a similar65interface. The links below are for some of the most common platforms,66which have instructions for Flask, WSGI, or Python.6768- `PythonAnywhere <https://help.pythonanywhere.com/pages/Flask/>`_69- `Google App Engine <https://cloud.google.com/appengine/docs/standard/python3/building-app>`_70- `Google Cloud Run <https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service>`_71- `AWS Elastic Beanstalk <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html>`_72- `Microsoft Azure <https://docs.microsoft.com/en-us/azure/app-service/quickstart-python>`_7374This list is not exhaustive, and you should evaluate these and other75services based on your application's needs. Different services will have76different capabilities, configuration, pricing, and support.7778You'll probably need to :doc:`proxy_fix` when using most hosting79platforms.