Skip to content

Instantly share code, notes, and snippets.

@exit99
Created February 10, 2015 15:22
Show Gist options
  • Save exit99/d19158f5662fc8bc4699 to your computer and use it in GitHub Desktop.
Save exit99/d19158f5662fc8bc4699 to your computer and use it in GitHub Desktop.
Flask shell with a manage.py
#!/usr/bin/env python
import sys
from flask.ext.script import Manager
from null.app import create_app
app = create_app()
manager = Manager(app)
@manager.shell
def shell():
return {
'app': app,
'db': None,
'models': None,
}
if __name__ == '__main__':
manager.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment