parent
b7a7994284
commit
48a6bd0c99
@ -0,0 +1,23 @@ |
||||
#!/usr/bin/env python |
||||
from flask.ext.script import Manager, Shell, Server |
||||
from {{ cookiecutter.repo_name }} import models |
||||
from {{ cookiecutter.repo_name }}.main import app, db |
||||
|
||||
manager = Manager(app) |
||||
|
||||
def _make_context(): |
||||
'''Return context dict for a shell session so you can access |
||||
app, db, and models by default. |
||||
''' |
||||
return {'app': app, 'db': db, 'models': models} |
||||
|
||||
@manager.command |
||||
def createdb(): |
||||
'''Create a database from the tables defined in models.py.''' |
||||
db.create_all() |
||||
|
||||
manager.add_command("runserver", Server()) |
||||
manager.add_command("shell", Shell(make_context=_make_context)) |
||||
|
||||
if __name__ == '__main__': |
||||
manager.run() |
@ -1,12 +1,12 @@ |
||||
# Everything that needed in production |
||||
Flask==0.10.1 |
||||
Flask-SQLAlchemy==1.0 |
||||
Flask-WTF==0.9.0 |
||||
Flask-WTF==0.9.2 |
||||
Jinja2==2.7 |
||||
MarkupSafe==0.18 |
||||
SQLAlchemy==0.8.2 |
||||
WTForms==1.0.4 |
||||
Werkzeug==0.9.3 |
||||
Werkzeug==0.9.4 |
||||
gunicorn==17.5 |
||||
itsdangerous==0.23 |
||||
wsgiref==0.1.2 |
||||
|
Loading…
Reference in new issue