Skip to content

Tag: javascript

AJAX post request with django and python

I am trying to build a web app on django where a user can record something which then gets turned into text and after that sent to the server with AJAX. I did some research and found this article: https://medium.com/@manask322/implementing-speech-to-text-feature-in-a-django-app-f0fa53bb3e03 So I copied the ht…

Python one line if condition like in Javascript

This is a valid syntax in JavaScript: The same behavior can be achieved like this in Python: Is there a Pythonic way how to get the same one-liner like in Javascript without explicitly using an if statement? Answer and is a short-circuit in python (as explained here), so will give you what you want

Passing an html element from anchor tag to django view

I would like to know how i can pass the html link element as a string into a django view and have the information rendered on that specific view. to be clear: I have this In html A django view rendered the items from a list and each item would ideally be clickable and the specific item would be passed