Skip to content

Commit

Permalink
Include Templates and Bump Version to 0.1.1
Browse files Browse the repository at this point in the history
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
kevin1024 committed Jun 1, 2014
1 parent 9074c32 commit a109bbb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,4 +1,6 @@
env/
build/
dist/
.workon
.epio-app
*.pyc
Expand Down
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion httpbin/core.py
Expand Up @@ -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)


# -----------
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@

setup(
name="httpbin",
version="0.1.0",
version="0.1.1",
description="HTTP Request and Response Service",

# The project URL.
Expand All @@ -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.