Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Commit

Permalink
adding a shell
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbe committed Oct 20, 2011
1 parent 9617d79 commit 12a2820
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bin/run_shell.py
@@ -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.