Created
May 3, 2009 20:16
-
-
Save erh/106148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo.connection import Connection , ConnectionFailure | |
import datetime | |
try: | |
connection = Connection("localhost", 27017) | |
except ConnectionFailure: | |
page_content = """<span class = "error">could not connect connect:besure that Mongo is running on localhost:27017</span>""" | |
except Exception, detail: | |
page_content = """<span class = "error">could not connect connect:besure that Mongo is running on localhost:27017</span>""" | |
print( "page_content:" + str( page_content ) ) | |
print( "page_content:" + str( connection ) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment