Permalink
Browse files

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
  • Loading branch information...
1 parent 9074c32 commit a109bbbe298a6ef565b29c5a83b61cb9063a10d6 @kevin1024 kevin1024 committed Jun 1, 2014
Showing with 22 additions and 2 deletions.
  1. +2 −0 .gitignore
  2. +14 −0 README.md
  3. +4 −1 httpbin/core.py
  4. +2 −1 setup.py
View
@@ -1,4 +1,6 @@
env/
+build/
+dist/
.workon
.epio-app
*.pyc
View
@@ -114,6 +114,20 @@ All endpoint responses are JSON-encoded.
"url": "http://httpbin.org/get?show_env=1"
}
+## Installing and running from PyPI
+
+You can install httpbin as a library from PyPI and run it as a WSGI app. For example, using Gunicorn:
+
+```bash
+$ pip install httpbin
+$ gunicorn httpbin:app
+```
+
+## Changelog
+
+* 0.1.1: Added templates as data in setup.py
+* 0.1.0: Added python3 support and (re)publish on PyPI
+
## AUTHOR
A [Kenneth Reitz](http://kennethreitz.com/pages/open-projects.html)
View
@@ -40,7 +40,10 @@
# Prevent WSGI from correcting the casing of the Location header
BaseResponse.autocorrect_location_header = False
-app = Flask(__name__)
+# Find the correct template folder when running from a different location
+tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
+
+app = Flask(__name__, template_folder=tmpl_dir)
# -----------
View
@@ -5,7 +5,7 @@
setup(
name="httpbin",
- version="0.1.0",
+ version="0.1.1",
description="HTTP Request and Response Service",
# The project URL.
@@ -28,5 +28,6 @@
'Programming Language :: Python :: 3.4',
],
packages=find_packages(),
+ include_package_data = True, # include files listed in MANIFEST.in
install_requires=['Flask','MarkupSafe','decorator','itsdangerous','six'],
)

0 comments on commit a109bbb

Please sign in to comment.