-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Until now I have been running this with Flask in development mode. But at some point, I would want to deploy it. How do you deploy a Flask application? Gunicorn or Waitress (behind Nginx) seem like the simplest options, and Waitress has no dependencies except for the stdlib, so let's go with it for now. It has a nice way to run things, I can just add a main in my app.py that starts Waitress. Now the only hairy problem to solve is configuration. 12-factor environment variables look nice at first, but with the Procfile, the Nix shell with PG* variables, and sometimes people throwing in .env files too ... in my experience, it ends up being a mess after all. Instead I think I'll add a simple toml file, and add a default configuration in the repository that works out of the box for a development checkout.
- Loading branch information
Showing
4 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
graft hanson/static | ||
graft hanson/templates | ||
global-exclude *.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from setuptools import find_packages, setup | ||
|
||
setup( | ||
name="hanson", | ||
version="0.0.0", | ||
packages=find_packages(), | ||
include_package_data=True, | ||
install_requires=[ | ||
"click", | ||
"flask", | ||
"jinja2", | ||
"psycopg2", | ||
"waitress", | ||
], | ||
scripts=[ | ||
"app.py", | ||
"cli.py", | ||
], | ||
) |