brubeck icon indicating copy to clipboard operation
brubeck copied to clipboard

Auto-reload Code during Development

Open DavidYKay opened this issue 13 years ago • 6 comments

The one thing that I'm missing from Django is the ability to leave a Brubeck Python app up and let it reload the source code automatically as I'm writing it.

What do we need to do to implement this? Would be happy to dive into this, but I'm not sure where to start. Thanks!

DavidYKay avatar Sep 28 '12 02:09 DavidYKay

Django's autoreload module may give an idea. Apparently they borrowed most of it from CherryPy.

https://github.com/django/django/blob/master/django/utils/autoreload.py

and here's CherryPy's autoreloader:

https://bitbucket.org/cherrypy/cherrypy/src/b0c48210b25018768532a370a522a660db6236f8/cherrypy/process/plugins.py#cl-540

faruken avatar Sep 28 '12 04:09 faruken

Got it! Reading the code now. Will take a shot at this.

DavidYKay avatar Sep 28 '12 15:09 DavidYKay

Sweet. I have a basic implementation working! Will start cleaning it up.

One issue: since Brubeck apps are invoked directly, while Django apps rely on manage.py runserver, should I ship this as an external tool, like manage.py? Or as a parameter in Brubeck.__init__()/Brubeck.run()?

Thanks for your patience! I'm new to this.

DavidYKay avatar Sep 28 '12 16:09 DavidYKay

I like the idea of a parameter, so I can define a debug var and the app launches in auto-reload, no debug var and it runs without it.

lkraider avatar Oct 29 '12 16:10 lkraider

Well, there is an option in werkzeug to do this, currently I am working on supporting multiple wsgi servers, I would suggest something to experiment with already existing one and then integrate to brubeck when we have enough knowledge. Anyways kudos to the idea

On Mon, Oct 29, 2012 at 10:09 PM, Paul Eipper [email protected]:

I like the idea of a parameter, so I can define a debug var and the app launches in auto-reload, no debug var and it runs without it.

— Reply to this email directly or view it on GitHubhttps://github.com/j2labs/brubeck/issues/87#issuecomment-9875497.

Thanks & Regards

"Talk is cheap, show me the code" -- Linus Torvalds kracekumar www.kracekumar.com *

kracekumar avatar Oct 29 '12 16:10 kracekumar

@DavidYKay did you ever complete this implementation? I'm interested in auto-reload as well as I use it a bunch in nodejs development with the node-dev module.

bdickason avatar Jun 22 '13 20:06 bdickason