Permalink
Browse files

adding a shell

  • Loading branch information...
1 parent 9617d79 commit 12a2820ff34efa316196c27d69274a7e8b089d82 @peterbe committed Oct 20, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 bin/run_shell.py
View
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+import code, re
+import here
+
+if __name__ == '__main__':
+
+
+ from models import User, Tweeter, connection
+ from pymongo.objectid import InvalidId, ObjectId
+
+ import settings
+ db = connection[settings.DATABASE_NAME]
+ print "AVAILABLE:"
+ print '\n'.join(['\t%s'%x for x in locals().keys()
+ if re.findall('[A-Z]\w+|db|con', x)])
+ print "Database available as 'db'"
+ code.interact(local=locals())

0 comments on commit 12a2820

Please sign in to comment.