Tobia Conforto
unread,Apr 7, 2012, 2:32:38 PM4/7/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi all
I'm developing a portlet bridge in Jython, to enable developing J2EE
portlets in Django, and I need to include a reload-on-code-change
feature, to aid in development.
Unfortunately, the way django.utils.autoreload works, by triggering a
complete restart of the Jython interpreter, has huge memory and thread
leaks in Jython. It would appear that there is no clean way to unload
a
Jython interpreter from the JVM once it's been started. (For backing
of
this assertion, see my latest post on the jython-users list.)
Therefore I'd like to know if there is a way to reload a Django
project
from within Python, without restarting the interpreter itself.
For normal development it would be enough to reload the project's own
models, views, urls, admin, form, middleware and such classes. Some
of
the settings could be kept, if it made the reloading simpler, such as
filesystem paths, database connections, installed apps and middleware.
Any changes to the standard library, Django, and in general any code
that is not part of the current project's module could be ignored. If
a developer needs to reload that, he can very well restart everything!
Does anybody have any advice on how to do this?
-Tobia