{"id":295,"date":"2024-11-16T10:09:24","date_gmt":"2024-11-16T09:09:24","guid":{"rendered":"https:\/\/www.systemdeveloper.nl\/tech\/?p=295"},"modified":"2024-11-16T10:37:27","modified_gmt":"2024-11-16T09:37:27","slug":"deploying-flask-applications-with-gunicorn-as-a-wsgi-server","status":"publish","type":"post","link":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/","title":{"rendered":"Deploying Flask Applications with Gunicorn as a WSGI Server"},"content":{"rendered":"<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Flask is a lightweight and powerful framework for building web applications, but it is not production-ready on its own. For production deployments, using a WSGI server like Gunicorn is an excellent choice. Gunicorn is reliable, scalable, and works seamlessly with Flask.<\/p>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">In this blog post, we&rsquo;ll walk through setting up Gunicorn to serve your Flask application efficiently.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"1-install-gunicorn\"><strong>1. Install Gunicorn<\/strong><\/h3>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">First, ensure Gunicorn is installed in your Python environment. If you don&rsquo;t have it yet, you can install it using pip:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>pip install gunicorn<\/textarea>\n<\/div><code>pip install gunicorn<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-flask-application-structure\"><strong>2. Flask Application Structure<\/strong><\/h3>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Let&rsquo;s assume you have the following Flask app structure:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>my_app\/\n&#9474;\n&#9500;&#9472;&#9472; app.py\n&#9492;&#9472;&#9472; requirements.txt<\/textarea>\n<\/div><code>my_app\/\n&#9474;\n&#9500;&#9472;&#9472; app.py\n&#9492;&#9472;&#9472; requirements.txt<\/code><\/pre>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Here&rsquo;s a basic example of what <code>app.py<\/code> might look like:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>from flask import Flask\n\napp = Flask(__name__)\n\n@app.route('\/')\ndef home():\n    return \"Hello, World!\"\n\nif __name__ == \"__main__\":\n    app.run()<\/textarea>\n<\/div><code>from flask import Flask\n\napp = Flask(__name__)\n\n@app.route('\/')\ndef home():\n    return \"Hello, World!\"\n\nif __name__ == \"__main__\":\n    app.run()<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"3-running-the-application-with-gunicorn\"><strong>3. Running the Application with Gunicorn<\/strong><\/h3>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Gunicorn serves your application using the WSGI interface. To run your Flask app with Gunicorn, navigate to the directory containing <code>app.py<\/code> and execute:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>gunicorn -w 4 -b 0.0.0.0:8000 app:app<\/textarea>\n<\/div><code>gunicorn -w 4 -b 0.0.0.0:8000 app:app<\/code><\/pre>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Here&rsquo;s what each option does:<\/p>\n\n\n<ul class=\"wp-block-list wp-block-list\">\n<li>\n<strong><code>-w 4<\/code><\/strong>: Starts 4 worker processes (adjust based on your server&rsquo;s CPU cores).<\/li>\n\n\n\n<li>\n<strong><code>-b 0.0.0.0:8000<\/code><\/strong>: Binds the application to all network interfaces on port 8000.<\/li>\n\n\n\n<li>\n<strong><code>app:app<\/code><\/strong>: Specifies the entry point for Gunicorn. The format is <code>MODULE_NAME:APP_VARIABLE_NAME<\/code>.<\/li>\n<\/ul>\n\n\n<h3 class=\"wp-block-heading\" id=\"4-making-gunicorn-production-ready\"><strong>4. Making Gunicorn Production-Ready<\/strong><\/h3>\n\n\n<h4 class=\"wp-block-heading\" id=\"configuring-gunicorn\"><strong>Configuring Gunicorn<\/strong><\/h4>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Instead of passing options via the command line, you can create a Gunicorn configuration file (<code>gunicorn.conf.py<\/code>) for better manageability. Example:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea># gunicorn.conf.py\nbind = \"0.0.0.0:8000\"\nworkers = 4\nloglevel = \"info\"\nerrorlog = \"\/var\/log\/gunicorn\/error.log\"\naccesslog = \"\/var\/log\/gunicorn\/access.log\"<\/textarea>\n<\/div><code># gunicorn.conf.py\nbind = \"0.0.0.0:8000\"\nworkers = 4\nloglevel = \"info\"\nerrorlog = \"\/var\/log\/gunicorn\/error.log\"\naccesslog = \"\/var\/log\/gunicorn\/access.log\"<\/code><\/pre>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Run Gunicorn with the configuration:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>gunicorn -c gunicorn.conf.py app:app<\/textarea>\n<\/div><code>gunicorn -c gunicorn.conf.py app:app<\/code><\/pre>\n\n\n<h4 class=\"wp-block-heading\" id=\"running-gunicorn-as-a-service\"><strong>Running Gunicorn as a Service<\/strong><\/h4>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">To ensure your app starts automatically on server boot, set up a systemd service for Gunicorn:<\/p>\n\n\n<ol class=\"wp-block-list wp-block-list\">\n<li>\n<strong>Create the Service File<\/strong><br>Create <code>\/etc\/systemd\/system\/my_app.service<\/code>:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>[Unit]\nDescription=Gunicorn instance to serve Flask application\nAfter=network.target\n\n[Service]\nUser=your_user\nGroup=your_group\nWorkingDirectory=\/path\/to\/your\/app\nExecStart=\/path\/to\/venv\/bin\/gunicorn -c \/path\/to\/gunicorn.conf.py app:app\n\n[Install]\nWantedBy=multi-user.target<\/textarea>\n<\/div><code>[Unit]\nDescription=Gunicorn instance to serve Flask application\nAfter=network.target\n\n[Service]\nUser=your_user\nGroup=your_group\nWorkingDirectory=\/path\/to\/your\/app\nExecStart=\/path\/to\/venv\/bin\/gunicorn -c \/path\/to\/gunicorn.conf.py app:app\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">2. Start and Enable the Service<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>sudo systemctl start my_app\nsudo systemctl enable my_app<\/textarea>\n<\/div><code>sudo systemctl start my_app\nsudo systemctl enable my_app<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"5-integrating-with-nginx\"><strong>5. Integrating with Nginx<\/strong><\/h3>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">While <a href=\"https:\/\/gunicorn.org\/\">Gunicorn<\/a> can serve requests directly, pairing it with a reverse proxy like <a href=\"https:\/\/nginx.org\/en\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx<\/a> improves performance and adds an extra layer of security. A typical Nginx configuration might look like this:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>server {\n    listen 80;\n    server_name yourdomain.com;\n\n    location \/ {\n        proxy_pass http:\/\/127.0.0.1:8000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    }\n}<\/textarea>\n<\/div><code>server {\n    listen 80;\n    server_name yourdomain.com;\n\n    location \/ {\n        proxy_pass http:\/\/127.0.0.1:8000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    }\n}<\/code><\/pre>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">After editing the configuration, reload Nginx:<\/p>\n\n\n<pre class=\"wp-block-code\"><div class=\"copy-to-clipboard\">\n<span>Copied!<\/span><button class=\"click-to-copy-button\" title=\"Copy to clipboard\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 32 32\" stroke=\"currentcolor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"24\" height=\"24\" fill=\"none\">\n  <path d=\"M12.9975 10.7499L11.7475 10.7499C10.6429 10.7499 9.74747 11.6453 9.74747 12.7499L9.74747 21.2499C9.74747 22.3544 10.6429 23.2499 11.7475 23.2499L20.2475 23.2499C21.352 23.2499 22.2475 22.3544 22.2475 21.2499L22.2475 12.7499C22.2475 11.6453 21.352 10.7499 20.2475 10.7499L18.9975 10.7499Z\"><\/path>\n  <path d=\"M17.9975 12.2499L13.9975 12.2499C13.4452 12.2499 12.9975 11.8022 12.9975 11.2499L12.9975 9.74988C12.9975 9.19759 13.4452 8.74988 13.9975 8.74988L17.9975 8.74988C18.5498 8.74988 18.9975 9.19759 18.9975 9.74988L18.9975 11.2499C18.9975 11.8022 18.5498 12.2499 17.9975 12.2499Z\"><\/path>\n  <path d=\"M13.7475 16.2499L18.2475 16.2499\"><\/path>\n  <path d=\"M13.7475 19.2499L18.2475 19.2499\"><\/path>\n<\/svg><\/button><textarea>sudo systemctl reload nginx<\/textarea>\n<\/div><code>sudo systemctl reload nginx<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"6-testing-your-deployment\"><strong>6. Testing Your Deployment<\/strong><\/h3>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Visit your server&#8217;s IP address or domain (e.g., <code>http:\/\/yourdomain.com<\/code>). If everything is set up correctly, your Flask application should be live and accessible.<\/p>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Our recently developed <a href=\"\/tech\/building-a-scalable-data-ingestion-api-with-influxdb-and-python\/\">Scalable Data Ingestion<\/a> is an excellent example to try this yourself.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h3>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\">Using Gunicorn as the WSGI server for your Flask application is a reliable and efficient way to handle production traffic. Pairing it with Nginx ensures better performance and added security. With this setup, you can confidently deploy and scale your Flask applications.<\/p>\n\n\n<p class=\"wp-block-paragraph wp-block-paragraph\" style=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flask is a lightweight and powerful framework for building web applications, but it is not production-ready on its own. For production deployments, using a WSGI server like Gunicorn is an excellent choice. Gunicorn is reliable, scalable, and works seamlessly with Flask. In this blog post, we&rsquo;ll walk through setting up Gunicorn to serve your Flask &hellip;<\/p>\n","protected":false},"author":1,"featured_media":296,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,46],"tags":[15],"class_list":["post-295","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-future-ideas","category-howto","tag-api"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Deploying Flask Applications with Gunicorn as a WSGI Server - SystemDeveloper.NL<\/title>\n<meta name=\"description\" content=\"For production deployments, using a WSGI server like Gunicorn is an excellent choice.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploying Flask Applications with Gunicorn as a WSGI Server - SystemDeveloper.NL\" \/>\n<meta property=\"og:description\" content=\"For production deployments, using a WSGI server like Gunicorn is an excellent choice.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/\" \/>\n<meta property=\"og:site_name\" content=\"SystemDeveloper.NL\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/quan.tora.16\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-16T09:09:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-16T09:37:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"John Timmer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Timmer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/\"},\"author\":{\"name\":\"John Timmer\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#\\\/schema\\\/person\\\/5760c2ed5300c56d8ef01dfb00a9763b\"},\"headline\":\"Deploying Flask Applications with Gunicorn as a WSGI Server\",\"datePublished\":\"2024-11-16T09:09:24+00:00\",\"dateModified\":\"2024-11-16T09:37:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/\"},\"wordCount\":360,\"publisher\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp\",\"keywords\":[\"API\"],\"articleSection\":[\"Future ideas\",\"Howto\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/\",\"url\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/\",\"name\":\"Deploying Flask Applications with Gunicorn as a WSGI Server - SystemDeveloper.NL\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp\",\"datePublished\":\"2024-11-16T09:09:24+00:00\",\"dateModified\":\"2024-11-16T09:37:27+00:00\",\"description\":\"For production deployments, using a WSGI server like Gunicorn is an excellent choice.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp\",\"contentUrl\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp\",\"width\":1024,\"height\":768,\"caption\":\"Deploying Flask Applications with Gunicorn as a WSGI Server\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploying Flask Applications with Gunicorn as a WSGI Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#website\",\"url\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/\",\"name\":\"www.systemdeveloper.nl\",\"description\":\"NextGen IT\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#organization\",\"name\":\"www.systemdeveloper.nl\",\"url\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/qt-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/qt-logo.png\",\"width\":1346,\"height\":1230,\"caption\":\"www.systemdeveloper.nl\"},\"image\":{\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/quan.tora.16\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/#\\\/schema\\\/person\\\/5760c2ed5300c56d8ef01dfb00a9763b\",\"name\":\"John Timmer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/cropped-D6E27035-6864-4270-8D72-0D8C0C59F370-96x96.jpeg\",\"url\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/cropped-D6E27035-6864-4270-8D72-0D8C0C59F370-96x96.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/cropped-D6E27035-6864-4270-8D72-0D8C0C59F370-96x96.jpeg\",\"caption\":\"John Timmer\"},\"sameAs\":[\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\"],\"url\":\"https:\\\/\\\/www.systemdeveloper.nl\\\/tech\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Deploying Flask Applications with Gunicorn as a WSGI Server - SystemDeveloper.NL","description":"For production deployments, using a WSGI server like Gunicorn is an excellent choice.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/","og_locale":"en_US","og_type":"article","og_title":"Deploying Flask Applications with Gunicorn as a WSGI Server - SystemDeveloper.NL","og_description":"For production deployments, using a WSGI server like Gunicorn is an excellent choice.","og_url":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/","og_site_name":"SystemDeveloper.NL","article_publisher":"https:\/\/www.facebook.com\/quan.tora.16","article_published_time":"2024-11-16T09:09:24+00:00","article_modified_time":"2024-11-16T09:37:27+00:00","og_image":[{"width":1024,"height":768,"url":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp","type":"image\/webp"}],"author":"John Timmer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Timmer","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/#article","isPartOf":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/"},"author":{"name":"John Timmer","@id":"https:\/\/www.systemdeveloper.nl\/tech\/#\/schema\/person\/5760c2ed5300c56d8ef01dfb00a9763b"},"headline":"Deploying Flask Applications with Gunicorn as a WSGI Server","datePublished":"2024-11-16T09:09:24+00:00","dateModified":"2024-11-16T09:37:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/"},"wordCount":360,"publisher":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/#organization"},"image":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp","keywords":["API"],"articleSection":["Future ideas","Howto"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/","url":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/","name":"Deploying Flask Applications with Gunicorn as a WSGI Server - SystemDeveloper.NL","isPartOf":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/#primaryimage"},"image":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp","datePublished":"2024-11-16T09:09:24+00:00","dateModified":"2024-11-16T09:37:27+00:00","description":"For production deployments, using a WSGI server like Gunicorn is an excellent choice.","breadcrumb":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/#primaryimage","url":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp","contentUrl":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/10ef8123-7d71-484e-b6d4-d7c445f7f5b9-e1731747870665.webp","width":1024,"height":768,"caption":"Deploying Flask Applications with Gunicorn as a WSGI Server"},{"@type":"BreadcrumbList","@id":"https:\/\/www.systemdeveloper.nl\/tech\/deploying-flask-applications-with-gunicorn-as-a-wsgi-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.systemdeveloper.nl\/tech\/"},{"@type":"ListItem","position":2,"name":"Deploying Flask Applications with Gunicorn as a WSGI Server"}]},{"@type":"WebSite","@id":"https:\/\/www.systemdeveloper.nl\/tech\/#website","url":"https:\/\/www.systemdeveloper.nl\/tech\/","name":"www.systemdeveloper.nl","description":"NextGen IT","publisher":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.systemdeveloper.nl\/tech\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/www.systemdeveloper.nl\/tech\/#organization","name":"www.systemdeveloper.nl","url":"https:\/\/www.systemdeveloper.nl\/tech\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.systemdeveloper.nl\/tech\/#\/schema\/logo\/image\/","url":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/qt-logo.png","contentUrl":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/qt-logo.png","width":1346,"height":1230,"caption":"www.systemdeveloper.nl"},"image":{"@id":"https:\/\/www.systemdeveloper.nl\/tech\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/quan.tora.16"]},{"@type":"Person","@id":"https:\/\/www.systemdeveloper.nl\/tech\/#\/schema\/person\/5760c2ed5300c56d8ef01dfb00a9763b","name":"John Timmer","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/cropped-D6E27035-6864-4270-8D72-0D8C0C59F370-96x96.jpeg","url":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/cropped-D6E27035-6864-4270-8D72-0D8C0C59F370-96x96.jpeg","contentUrl":"https:\/\/www.systemdeveloper.nl\/tech\/wp-content\/uploads\/2024\/11\/cropped-D6E27035-6864-4270-8D72-0D8C0C59F370-96x96.jpeg","caption":"John Timmer"},"sameAs":["https:\/\/www.systemdeveloper.nl\/tech"],"url":"https:\/\/www.systemdeveloper.nl\/tech\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":2,"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":298,"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/posts\/295\/revisions\/298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/media\/296"}],"wp:attachment":[{"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemdeveloper.nl\/tech\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}