Permalink
Browse files

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

…this and the patch.
  • Loading branch information...
1 parent dc694bf commit 9b33b3b97e5908970241a1cd6ad0f669dc2baef7 @toastdriven committed Dec 5, 2009
Showing with 4 additions and 3 deletions.
  1. +1 −0 AUTHORS
  2. +1 −1 README.rst
  3. +2 −2 examples/static_files.py
View
@@ -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
@@ -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:
@@ -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()

0 comments on commit 9b33b3b

Please sign in to comment.