From 32ae81ec35589ec1eb528d51b5921db33633087a Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 8 Dec 2013 11:27:46 -0600 Subject: [PATCH] Shell access to User --- {{cookiecutter.app_name}}/README.rst | 2 +- {{cookiecutter.app_name}}/manage.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.app_name}}/README.rst b/{{cookiecutter.app_name}}/README.rst index ea94d66..aec57ff 100644 --- a/{{cookiecutter.app_name}}/README.rst +++ b/{{cookiecutter.app_name}}/README.rst @@ -33,7 +33,7 @@ To open the interactive shell, run :: python manage.py shell -By default, you will have access to ``app`` and ``db``. +By default, you will have access to ``app``, ``db``, and the ``User`` model. Running Tests diff --git a/{{cookiecutter.app_name}}/manage.py b/{{cookiecutter.app_name}}/manage.py index 9fd9e35..920466c 100644 --- a/{{cookiecutter.app_name}}/manage.py +++ b/{{cookiecutter.app_name}}/manage.py @@ -7,6 +7,7 @@ from flask.ext.script import Manager, Shell, Server from flask.ext.migrate import MigrateCommand from {{cookiecutter.app_name}}.app import create_app +from {{cookiecutter.app_name}}.user.models import User from {{cookiecutter.app_name}}.settings import DevConfig, ProdConfig from {{cookiecutter.app_name}}.database import db @@ -20,9 +21,9 @@ TEST_CMD = "nosetests" def _make_context(): '''Return context dict for a shell session so you can access - app and db by default. + app, db, and the User model by default. ''' - return {'app': app, 'db': db} + return {'app': app, 'db': db, 'User': User} @manager.command def test():