Hi i am trying to return a json file to the chrome extention to show it to the user, the query go to server without a problem, fetched url is also working and does return the json file when i try it directly, but the chrome extention shows “undefined” message in the alert instead of the json file. the returned
Tag: python
how to send multi args to Django custom templates from JS code inside HTML template
I’m trying to use a custom template tag to run a specific function on a variable that I get in JS inside my HTML template. here is a sample of what I tried : python template tag then am using it inside my HTML js block like this : The problem here is in adding the JS variable inside the
reading JavaScript object in a file into a Python array
I have a javascript file that has an object I’d like to be read by Python (Python 3 is just fine). Something like this: I want to convert myObject to a python dict object. Note I don’t really need the functions, just keys and values. I’m fine with (and capable) adding comment markers before/after and isolating the object. But I
Sending a profile picture from react frontend to flask-restful backend and storing
I want to store profile pictures on the file system (images/{username}_pfp.{extension} and store its location in the database as a string. My frontend react code is and my flask backend code is I have gotten the bits of code relevant to this from multiple sources (Flask – Get the name of an uploaded file minus the file extension, https://flask.palletsprojects.com/en/2.1.x/patterns/fileuploads/). When
javascript to enable and disable a button based on changes in form
i am using a javscript to enable a button based on the changes in the form field in django python using bootstrap.below is the script also the below code in html to initially disable button but the button stays disabled even after changing values in the field.any help would be appreciated Answer you need to add the below script });
Error :Forbidden (CSRF token missing or incorrect.) while using django rest framework
I use in my study project django rest framework.I get an error 403 Forbidden (CSRF token missing or incorrect, when I try to save using the POST method. Here is my code html Here is my code js: Here is my views.py: Here is my urls.py: I added the last path and logged in. In the api interface it became
Add texture of img1 to img2 to get result img – Python / Javascript
I am trying to add texture and pattern of img1 to img2 to get result something like the result image img3 – Img2 is has transparent background and result Img3 must also have transparent background Img1 Img2 Img3 Answer Here is how to do that in Imagemagick. It can be done in Python/OpenCV, but I do not have the time
How can access input value in django view through AJAX without form submission
I am beginner in django.I am working on a single text box in a django form which have number of fields.I wrote AJAX code for passing each value(entered from keyboard). How can i access this value in django class based view code. I want to save this value into a variable. Here i am trying to check given text is
How to render Streamable image on React coming from FastAPI server?
I would like to render an image on React returned from FastAPI backend using StreamingResponse. The image is in the form of a numpy array, which is of cv2 type of object. Here, I have created an API endpoint in which the uploaded image is received using POST request, and a StreamableResponse(Image) is returned. How can I render this returned
how to convert blob to wav file in javascript and connect python flask
I want to create web app using STT model by python flask. when user record the voice and send it server, trans it to text on web. there is my javascript part: and there is flask part: it comes out error I don’t know why blob didn’t convert to wav…how can I fix it? probably there are many no necessary