Skip to content

Commit a109bbb

Browse files
committed
Include Templates and Bump Version to 0.1.1
I forgot to include the templates in setup.py, so httpbin would complain and return a 500 when accessing views that require templates. This fixes that problem by adding them as "data" in setup.py and MANIFEST.in
1 parent 9074c32 commit a109bbb

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
env/
2+
build/
3+
dist/
24
.workon
35
.epio-app
46
*.pyc

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ All endpoint responses are JSON-encoded.
114114
"url": "http://httpbin.org/get?show_env=1"
115115
}
116116

117+
## Installing and running from PyPI
118+
119+
You can install httpbin as a library from PyPI and run it as a WSGI app. For example, using Gunicorn:
120+
121+
```bash
122+
$ pip install httpbin
123+
$ gunicorn httpbin:app
124+
```
125+
126+
## Changelog
127+
128+
* 0.1.1: Added templates as data in setup.py
129+
* 0.1.0: Added python3 support and (re)publish on PyPI
130+
117131
## AUTHOR
118132

119133
A [Kenneth Reitz](http://kennethreitz.com/pages/open-projects.html)

httpbin/core.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
# Prevent WSGI from correcting the casing of the Location header
4141
BaseResponse.autocorrect_location_header = False
4242

43-
app = Flask(__name__)
43+
# Find the correct template folder when running from a different location
44+
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
45+
46+
app = Flask(__name__, template_folder=tmpl_dir)
4447

4548

4649
# -----------

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="httpbin",
8-
version="0.1.0",
8+
version="0.1.1",
99
description="HTTP Request and Response Service",
1010

1111
# The project URL.
@@ -28,5 +28,6 @@
2828
'Programming Language :: Python :: 3.4',
2929
],
3030
packages=find_packages(),
31+
include_package_data = True, # include files listed in MANIFEST.in
3132
install_requires=['Flask','MarkupSafe','decorator','itsdangerous','six'],
3233
)

0 commit comments

Comments
 (0)