Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixed typos/formatting in three pages #31

Merged
merged 1 commit into from

2 participants

Steve Koch Aaron Swartz
Steve Koch

images.md
install.md
quick_vhosting_hack.md

Steve Koch stevekochscience fixed typos/formatting in a few files:
images.md
install.md
quick_vhosting_hack.md
ab74372
Aaron Swartz aaronsw merged commit 9713861 into from
Aaron Swartz
Owner

Thanks so much for fixing these!

Steve Koch

You're welcome! I'm new to python and this world of "real" coding--Your tutorial is great (along with web.py of course), and I find it very satisfying that there's a way for me to suggest changes to tutorial, while I'm reading it. And that those changes go live so quickly. And that I am competent enough to use git/github and send a pull request. Thank you for web.py and your responsiveness!

Aaron Swartz
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 1, 2012
  1. Steve Koch

    fixed typos/formatting in a few files:

    stevekochscience authored
    images.md
    install.md
    quick_vhosting_hack.md
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 13 deletions.
  1. +5 −5 images.md
  2. +5 −3 install.md
  3. +6 −5 quick_vhosting_hack.md
10 images.md
View
@@ -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()
8 install.md
View
@@ -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:
11 quick_vhosting_hack.md
View
@@ -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
Something went wrong with that request. Please try again.