« Return to Thread: Reloading of django views.py in modjy

Reloading of django views.py in modjy

by David Johansson :: Rate this Message:

Reply to Author | View in Thread

Hi all,

I'm new here so if this is the wrong place for this question don't
hesitate to yell at me :-)

I'm trying to run django inside a WAR file with modjy on a JBoss 4.2.2
Application server. (Next step is to integrate it into  a jboss seam
project)
The deployment time isn't great so I'm trying to get jython/modjy to
reload my django application on change of a source file, as in the
development server of django.

I tried a lot of things. modjy will reload application.py on
modification, so I tried to manually reload my views.py. Something
like:

def handler(environ, start_response):
    os.putenv("DJANGO_SETTINGS_MODULE", "clean.settings")
    h = wsgi.WSGIHandler()
    import hello.views
    reload(hello.views)
    return h(environ, start_response)

Didn't work. So I tried further to remove the views$py.class file, and
indeed it get's compiled if I remove it manually and touch
application.py causing modjy to reload it and in turn triggers my
import.
An judging by changing filesize of views$py.class it would seem it's
the updated views.py it compiles, but it still runs the old code! If I
remove both views.py and it's class, then touch application.py i get a
"No module named views" error...

So basically:
  1) Has anyone done anything like this?
  2) Why does it not execute the compile code? (is it a java thing?)
  3) Am I barking up the wrong tree?

If anyone has any clue what I could try next It would be greatly appriated!

Thanks!
/davidj

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

 « Return to Thread: Reloading of django views.py in modjy