Answer the question
In order to leave comments, you need to log in
Is such an entry safe in the django db?
An ajax request comes the text from the textarea field. Those. js I select the text from the field and send it to the server.
...
axios.post("{% url 'ajax' %}",{
xsrfHeaderName: "X-CSRFToken",
data: {
"text": self.note_t
},
...
@csrf_exempt
def ajax(request):
...
if request.method == 'POST':
...
note = Notes.objects.get(user=request.user)
note.text = text
note.save(update_fields=['text'])
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question