def mem(): form = ReciteForm() if form.validate_on_submit(): b = Bible() actual = b.get_verse(request.args.get("book").lower(), request.args.get("chapter"), request.args.get("verse"), "esv") typed = form.text.data d = Diff(actual, typed) html = d.generate_html() return html return render_template('mem.html', form=form, book=request.args.get("book"), chapter=request.args.get("chapter"), verse=request.args.get("verse"))
def verse(request, book, chapter, verse): bible = Bible() verse = bible.get_verse(book, chapter, verse) return HttpResponse(json.dumps(verse), mimetype='application/json')