Skip to content
Browse files

Merge pull request #31 from stevekochscience/master

fixed typos/formatting in three pages
  • Loading branch information...
2 parents 7e1bcec + ab74372 commit 97138610d83eb4cd4e28584ccd55ea080baa5302 @aaronsw aaronsw committed Aug 1, 2012
Showing with 16 additions and 13 deletions.
  1. +5 −5 images.md
  2. +5 −3 install.md
  3. +6 −5 quick_vhosting_hack.md
View
10 images.md
@@ -7,7 +7,7 @@ title: Serving Images
## Basic Directory Set-up
-First let your urls extend beyound images:
+First let your urls extend beyond images:
import web
@@ -25,12 +25,12 @@ Now create the class that will handle them:
cType = {
"png":"images/png",
- "jpg":"image/jpeg",
- "gif":"image/gif",
- "ico":"image/x-icon" }
+ "jpg":"images/jpeg",
+ "gif":"images/gif",
+ "ico":"images/x-icon" }
if name in os.listdir('images'): # Security
web.header("Content-Type", cType[ext]) # Set the Header
return open('images/%s'%name,"rb").read() # Notice 'rb' for reading images
else:
- raise web.notfound()
+ raise web.notfound()
View
8 install.md
@@ -157,8 +157,9 @@ Note: The way `web.py` is implemented breaks the `cgitb` module because it captu
# ... import web etc here...
def cgidebugerror():
- """
- """ _wrappedstdout = sys.stdout
+ """
+ """
+ _wrappedstdout = sys.stdout
sys.stdout = web._oldstdout
cgitb.handler()
@@ -175,7 +176,8 @@ FastCGI is easy to configure and performs as well as mod_python.
Add this to your `.htaccess`:
- <Files code.py> SetHandler fastcgi-script
+ <Files code.py>
+ SetHandler fastcgi-script
</Files>
Unfortunately, unlike lighttpd, Apache gives no hint that it wants your web.py script to act as a FastCGI server so you have to tell web.py explicitly. Add this to `code.py` before your `if __name__ == "__main__":` line:
View
11 quick_vhosting_hack.md
@@ -9,11 +9,11 @@ Here is a 10 minute hack with lots of room for improvement but I think its
pretty useful. I made this to allow the serving of multiple
sites from a single webpy app.
-I created this because I would like to run a few small sites but my cheep
+I created this because I would like to run a few small sites but my cheap
account at my hosting provider:
- * Only allows 40MB to be used by persistant processes.
- * Only allows *one* persistant process.
+ * Only allows 40MB to be used by persistent processes.
+ * Only allows *one* persistent process.
* Multiple instances of webpy would require multiple ports to be proxied with apache's mod_proxy
and this configuration can only be done by the server admin.
@@ -56,7 +56,7 @@ The /static directory is currently still shared between all sites.
#
## VHOSTING DECORATOR
- #
+ #
def vhostrr(vhosts=vhosts):
def decorator(func):
def proxyfunc(*args, **kw):
@@ -70,7 +70,8 @@ The /static directory is currently still shared between all sites.
print 'Error, Not configured for vhost: '+rd
return
else:
- print 'Direct access not allowed. Use proxy.' return
+ print 'Direct access not allowed. Use proxy.'
+ return
return func(mapping=mapping, *args, **kw)
return proxyfunc
return decorator

0 comments on commit 9713861

Please sign in to comment.
Something went wrong with that request. Please try again.