In django how can I make the result of the background program as a record and then insert it to mysql
<p>In django, I want to make the result of the program in server as a record and then insert it to the mysql, how can I do this?</p>

<p>If your program is part of django, you can just follow <a href="https://docs.djangoproject.com/en/1.10/topics/db/queries/#creating-objects" rel="nofollow">Creating objects</a>, if not, you can do something in your program settings:</p>

<pre><code>import django
os.environ['DJANGO_SETTINGS_MODULE'] = 'your_django_project.settings'
django.setup()
</code></pre>

<p>Then you can use django orm as above </p>

python django