I am trying to pass in a value i got in a views.py file in Django into another python script i wrote, but i have no idea how to do so. Here is my code from views.py file:
def get_alarm_settings(request):
if request.method == 'POST':
username = request.POST.get('username')
password = request.POST.get('password')
alarm = Alarm.objects.all()[0].alarm_setting
response = HttpResponse(alarm, content_type='text/plain')
response_a = execfile('alarm_file.py')
return response_a
I am trying to pass response into alarm_file.py, does anyone know how to do that?
importthe relevant function and call it?