Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed the static file serving example. Thanks to mronge for noticing …

…this and the patch.
  • Loading branch information...
commit 9b33b3b97e5908970241a1cd6ad0f669dc2baef7 1 parent dc694bf
@toastdriven authored
Showing with 4 additions and 3 deletions.
  1. +1 −0  AUTHORS
  2. +1 −1  README.rst
  3. +2 −2 examples/static_files.py
View
1  AUTHORS
@@ -9,3 +9,4 @@ Contributors:
* Christian Metts for various patches and suggestions
* marly for a patch to an exception's message
* tstromberg for a patch related to printing tracebacks on errors
+ * mronge for a patch to the static files example
View
2  README.rst
@@ -4,7 +4,7 @@ itty.py
The itty-bitty Python web framework.
-``itty.py`` is a little experiment, an attempt at a Sinatra_ influenced
+``itty.py`` is a little experiment, an attempt at a Sinatra_ influenced
micro-framework that does just enough to be useful and nothing more.
Currently supports:
View
4 examples/static_files.py
@@ -11,8 +11,8 @@ def index(request):
# file.
@get('/media/(?P<filename>.+)')
def my_media(request, filename):
- my_media.content_type = content_type(filename)
my_root = os.path.join(os.path.dirname(__file__), 'media')
- return static_file(request, filename=filename, root=my_root)
+ output = static_file(request, filename=filename, root=my_root)
+ return Response(output, content_type=content_type(filename))
run_itty()
Please sign in to comment.
Something went wrong with that request. Please try again.