views.py 462 Bytes
from django.shortcuts import render

import socket
import alert_manager

def alert_simulation(request):
    # je render juste la page
    return render(request, "alert_manager/alert_simulation.html", {})

def alert_simulation_start(request):
    clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    clientsocket.connect((alert_manager.tasks.IP, alert_manager.tasks.PORT))
    return render(request, "alert_manager/alert_simulation.html", {})