Added configuration file to Tweetcast Gevent Server
authorRaphael Velt <raph.velt@gmail.com>
Mon, 12 Dec 2011 14:26:20 +0100
changeset 405 6626b728b142
parent 404 89968844eb7d
child 406 86b62b98fea7
Added configuration file to Tweetcast Gevent Server
tweetcast/server-gevent/server_setup.py
tweetcast/server-gevent/tweetcast.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tweetcast/server-gevent/server_setup.py	Mon Dec 12 14:26:20 2011 +0100
@@ -0,0 +1,2 @@
+SQL_CONNECT = 'postgresql://user:pass@hostname/database'
+WEB_PORT = 8888
\ No newline at end of file
--- a/tweetcast/server-gevent/tweetcast.py	Mon Dec 12 12:54:14 2011 +0100
+++ b/tweetcast/server-gevent/tweetcast.py	Mon Dec 12 14:26:20 2011 +0100
@@ -11,9 +11,10 @@
 from gevent.pywsgi import WSGIServer
 from urlparse import parse_qs
 import datetime
+from server_setup import SQL_CONNECT, WEB_PORT
 
 Base = declarative_base()
-engine = create_engine('postgresql://raph:yusao6Kh@localhost/tweets')
+engine = create_engine(SQL_CONNECT)
 Session = sessionmaker(bind=engine)
 
 class TweetSource(Base):
@@ -134,4 +135,4 @@
 		return ['<h1>Not Found</h1>']
 
 session = Session()
-WSGIServer(('', 8888), webserver).serve_forever()
\ No newline at end of file
+WSGIServer(('', WEB_PORT), webserver).serve_forever()
\ No newline at end of file