M
M
maddread2016-01-15 13:28:55
Django
maddread, 2016-01-15 13:28:55

How to run python script from django model?

I need to run a python script from a django model method with arguments passed to it and get the result of its work (the exit function).
Tell me how best to do it.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Kitaev, 2016-01-15
@maddread

os.system or subprocess
But you don't have to do that. With a probability of 99.9%, you have problems with the architecture if you need to call not a program, but a python script.

V
Vladimir, 2016-01-15
@vintello

it's not possible just a
dajanga written in python can't run other python code.
it's better to do nothing. let it live like that.
By the way, is it possible to run another python application from a python application? or any other application?

Z
zelsky, 2016-01-15
@zelsky

Isn't it easier to pass arguments to the method and return the result from the method?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question