[Flask] Auto reload Models in Flask-script shell (ipython)

David Lord davidism at gmail.com
Mon Jan 30 13:10:28 EST 2017


You cannot reliably reload code in the Python shell. Restart your shell to
use updated code.

On Mon, Jan 30, 2017 at 4:42 AM, Jeffrey Levesque via Flask <
flask at python.org> wrote:

> Hi Graeme,
>
> I'm on my cell, so not very good for typing.  This is the flask unit
> testing method I use:
>
> - https://www.quora.com/What-is-the-best-python-test-
> framework/answer/Jeff-Levesque
>
> Granted, I'd look at the repositories master branch, since minor things
> may have changed.  Also, if you find my approach is bad, please correct me
> - input is always great.
>
>
> Thank you,
>
> Jeff Levesque
> https://github.com/jeff1evesque
>
> > On Jan 30, 2017, at 6:47 AM, Graeme Pillemer <gpillemer at gmail.com>
> wrote:
> >
> > Hi,
> > I often use the ipython shell in Flask-script when developing to
> validate code snippets and debug my flask models. Overall it works great.
> >
> > Only one problem I've found with this workflow is that if you change
> some line of code, it will not 'autoreload' the code or model classes. So I
> find I do a lot of shutting down the shell and restarting it:
> >
> > I've tried using the ipython autoreload magic function - which does not
> help
> >
> > Wondering if anyone on this thread has experienced this and knows a work
> around
> >
> > Thanks
> > _______________________________________________
> > Flask mailing list
> > Flask at python.org
> > https://mail.python.org/mailman/listinfo/flask
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20170130/069355a4/attachment.html>


More information about the Flask mailing list