<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?action=history&amp;feed=atom&amp;title=Flask%2FGunicorn</id>
	<title>Flask/Gunicorn - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?action=history&amp;feed=atom&amp;title=Flask%2FGunicorn"/>
	<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Flask/Gunicorn&amp;action=history"/>
	<updated>2026-08-04T10:28:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Flask/Gunicorn&amp;diff=330989&amp;oldid=prev</id>
		<title>Manetta: Created page with &quot;''A subpage of Flask''  ==How to install a Flask application using Gunicorn?==  First install gunicorn and python-dotenv:   $ uv pip3 install gunicorn python-dotenv  And then make or change the following files:  '''Makefile'''  &lt;pre&gt; include .env export  default: local  local:         @flask --app ${APPLICATION_NAME} --debug run  server:         @SCRIPT_NAME=${APPLICATION_ROOT} gunicorn -b localhost:${PORTNUMBER} --reload ${APPLICATION_NAME}:app &lt;/pre&gt;  '''.env'''  &lt;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Flask/Gunicorn&amp;diff=330989&amp;oldid=prev"/>
		<updated>2026-04-08T13:42:07Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;A subpage of &lt;a href=&quot;/mediadesign/Flask&quot; title=&quot;Flask&quot;&gt;Flask&lt;/a&gt;&amp;#039;&amp;#039;  ==How to install a Flask application using Gunicorn?==  First install gunicorn and python-dotenv:   $ uv pip3 install gunicorn python-dotenv  And then make or change the following files:  &amp;#039;&amp;#039;&amp;#039;Makefile&amp;#039;&amp;#039;&amp;#039;  &amp;lt;pre&amp;gt; include .env export  default: local  local:         @flask --app ${APPLICATION_NAME} --debug run  server:         @SCRIPT_NAME=${APPLICATION_ROOT} gunicorn -b localhost:${PORTNUMBER} --reload ${APPLICATION_NAME}:app &amp;lt;/pre&amp;gt;  &amp;#039;&amp;#039;&amp;#039;.env&amp;#039;&amp;#039;&amp;#039;  &amp;lt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;''A subpage of [[Flask]]''&lt;br /&gt;
&lt;br /&gt;
==How to install a Flask application using Gunicorn?==&lt;br /&gt;
&lt;br /&gt;
First install gunicorn and python-dotenv:&lt;br /&gt;
&lt;br /&gt;
 $ uv pip3 install gunicorn python-dotenv&lt;br /&gt;
&lt;br /&gt;
And then make or change the following files:&lt;br /&gt;
&lt;br /&gt;
'''Makefile'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include .env&lt;br /&gt;
export&lt;br /&gt;
&lt;br /&gt;
default: local&lt;br /&gt;
&lt;br /&gt;
local:&lt;br /&gt;
        @flask --app ${APPLICATION_NAME} --debug run&lt;br /&gt;
&lt;br /&gt;
server:&lt;br /&gt;
        @SCRIPT_NAME=${APPLICATION_ROOT} gunicorn -b localhost:${PORTNUMBER} --reload ${APPLICATION_NAME}:app&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''.env'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
APPLICATION_NAME=observations&lt;br /&gt;
APPLICATION_ROOT=/sergio/manettasobservations&lt;br /&gt;
PORTNUMBER=5100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''settings.py'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
from dotenv import main&lt;br /&gt;
&lt;br /&gt;
# Load environment variables from the .env file&lt;br /&gt;
main.load_dotenv()&lt;br /&gt;
&lt;br /&gt;
# Bind them to Python variables&lt;br /&gt;
APPLICATION_ROOT = os.environ.get('APPLICATION_ROOT', '/')&lt;br /&gt;
PORTNUMBER = int(os.environ.get('PORTNUMBER', 5000))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app.py'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# load the settings of the applicaiton&lt;br /&gt;
# (to handle the routing correctly)&lt;br /&gt;
app.config.from_pyfile('settings.py')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''nginx'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# overlap flask application&lt;br /&gt;
location ^~ /overlap/static/ {&lt;br /&gt;
    alias /var/www/html/breadbrick/SI21/week5/static/;&lt;br /&gt;
    autoindex on;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
location ^~ /overlap/ {&lt;br /&gt;
    proxy_pass http://localhost:5000/breadcube/overlap/;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Manetta</name></author>
	</entry>
</feed>