django - Deploying matlab app on the web using python -


hi want deploy matlab application on web using python. there way it.i have converted application jar files (java classes) per documentation on math works site. can point me in right direction go ahead

the fact matlab code packaged jars may not here, @ least not pure python.

there few ways can take code written in java , expose python.

jython

if willing give jython shot may easy way provide django interface jars.

basically you'll write normal django app , use jython work natively jars. best of both worlds assuming aren't tied cpython.

django-jython

java compatibility interfaces

on cpython either of following projects work code in jar files:

  • jcc: create python extension module wraps jar file
  • jpype: provides api running jvm , calling code running in jvm python.

separate process:

if have standalone program written in matlab (really language) execute child process of django application. you'd simple web form in django allowed submit values inputs process , in view (after validating form) you'd like:

command = "mymatlabprogram.exe %s"%(arg1,) process = subprocess.popen(command.split()) stdout, stderr = process.communicate() 

assuming worked pull answers out of stdout or error messages out of stderr. serve image created process, etc. once working celeryd extract subprocess stuff web app.

the advantage of working separate process isolate bugs in matlab code breaking web application , vice versus. disadvantage have serialize , work multiple times between client's browser , web app, between web app , executable, , client.


Comments