Tuesday, May 31, 2011

Re: python code works in command line but not in django

Hi All,

I apologize for now being specific enough. The java script should read
files in "tmp/medusa" and use "Medusa.jar" as the referenced class to
run. The result of the script should be a png image using data from
files inside "tmp/medusa"

I tested the java command via terminal and it worked fine. The PNG
image was created correctly.

I tested the python package using python shell by importing
MedusaConnector and run the "MedusaConnector.create_image()", and the
PNG image was created properly as well.

Therefore, I imported the Medusa package into my views.py and try to
run it using django. This time, the PNG file was created, but with and
empty image unlike those 2 previous test cases.

Really have no idea what's going on here...

Kann

On May 31, 10:48 am, bruno desthuilliers
<bruno.desthuilli...@gmail.com> wrote:
> On May 31, 10:32 am, Lucian Nicolescu <lucia...@gmail.com> wrote:
>
> > I don't think there's any way this could work.
>
> Oh yes ? Why so ?
>
> > From what I can tell
> > Kann is trying to invoke the java interpreter ...
>
> Indeed.
>
> > but he does it on
> > the server, not on the user's machine
>
> And ?
>
> > - that's why it only works when the two are the same.
>
> Please think twice before posting.
>
> The OP never talked about "code working on it's own machine and not on
> the production server", but about "code working from within the python
> shell and not from the views". Not quite the same problem.
>
> FWIW, nothing prevents a java interpreter from being launched on the
> same machine as the django app (it's even a rather common use case),
> and as long as everything is correctly deployed and the env, path and
> perms are ok there's no reason it shouldn't work as well on a dev
> workstation, staging server or production server.
>
> > So he should try to invoke it somehow else, maybe embed it in a html
> > page if it's a Applet or just link to the .jar file directly and
> > normally the Java machine will automatically pick it up (if installed
> > on the user's machine).
>
> What makes you think the java program is supposed to run on the user
> machine exactly ?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment