def make(request): on = commands.last_command() == commands.ON if on: return HttpResponseRedirect(reverse("waiting")) form = MakeForm() if request.method == "POST": form = MakeForm(request.POST) if form.is_valid(): twitter = form.cleaned_data["twitter"] commands.send_on(twitter) return HttpResponseRedirect(reverse("waiting")) return direct_to_template(request, "make.html", {"form": form})
def waiting(request): twitter = commands.last_twitter() command = commands.last_command() return direct_to_template(request, "waiting.html", {"twitter": twitter, "command": command})
def check(request): return HttpResponse(commands.last_command())