from django.db import models
import os
from django.db.models.signals import post_save
import sys
class Form(models.Model):
site = models.CharField(max_length=50)
num = models.CharField(max_length=10)
octet = models.CharField(max_length=30)
def __unicode__(self):
return self.site
return self.num
return self.octet
def create_conf(sender, **kwargs):
os.system("/usr/local/build " + self.site + ' ' + self.num + ' ' + self.octet)
post_save.connect(create_conf, sender=Form)
Trying to get my django web app to execute python command line application with arguments. Not sure if this is the best way to go around it? If its not any advice would be great. Trying to take input from user via web form and use it as the arguments to execute cmd application.
Help would be fantastic
Thanks William