我只是在学习Django和一般的web开发,我想知道我想做什么是可能的。我想编写一个Django测验,保存用户输入的答案,而不需要后端。这是可能的吗?如果不可能,我可以做到这一点的最简单和最简单的方法是什么。我的模板:如何保存用户的输入而不需要backeneds
{% extends "base.html" %}
{% block title %}Exam Questions{% endblock %}
{% block content %}
{% if all_questions %}
<form action="{% url 'save_answer' %}" method="post">
{% csrf_token %}
{% for question in all_questions %}
<h3>{{question.text }}</h3>
<input type="hidden" name="exam_id" value="{{ question.exam.id }}">
<input type="hidden" name="question_id" value="{{ question.id }}">
<input type="hidden" value="{{question.answer_set.all}}" name="answers">
{% for answer in question.answer_set.all %}
<p><input type="radio" name="answer" value="{{ answer.id }}">{{ answer.text }}</p>
{% endfor %}
{% endfor %}
<input type="submit" value="Send">
</form>
{% else %}
<h2>No questions available</h2>
{% endif %}
{% endblock %}
现在我想知道如何保存用户的答案,而不后端
没有后端* *什么?你想做什么? –