reactjs

Regex finding entire line from paragraph

Regex finding entire line from paragraph Question: I need to find the actual line from the paragraph, and the paragraph drawing by the markdown editor you can add a checkbox, radio, textbox, and paragraph through the editor. The actual str is something like this, this is paragraph line1 ?[question_2]{"category":[]}[who are you]=[] {1,2} [] OPTION 1 …

Total answers: 2

Deploy React's build folder via FastAPI

Deploy React's build folder via FastAPI Question: I want to serve my React frontend using FastAPI. The goal being 0 Javascript dependency for the user. The user can simply download the Python code, start server, and view the website on localhost. My folder structure is: – my-fullstack-app – frontend/ – build/ – public/ – … …

Total answers: 2

React not showing POST response from FastAPI backend application

React not showing POST response from FastAPI backend application Question: I have a simple React Ui which is supposed to get a json file from localhost:8000/todo and create the Ui in localhost:3000. This is the desired output: However, this is what I get: So, the two lines which are "Read a book." and "Cycle around …

Total answers: 1

How to render Streamable image on React coming from FastAPI server?

How to render Streamable image on React coming from FastAPI server? Question: 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. @app.post("/predict") async def root(file: UploadFile = File(…)): global model global store_coordinates …

Total answers: 1

React to django CORS issue

React to django CORS issue Question: Error Details Two requests have been generating on button click. What did I search so far? Axios blocked by CORS policy with Django REST Framework CORS issue with react and django-rest-framework but to no avail What am I doing? Submitting POST request from react to DJango API Django side …

Total answers: 5

React rendered components from Django doesn't show after reloading

React rendered components from Django doesn't show after reloading Question: I have a Django project that emits Javascript(ReactJS) to the browser as frontend. It’s an SSR app — Django renders a view with a template that loads a React script. Everything works just fine except when I go to a different page(React component routed with …

Total answers: 1

React – Django page is blank on refresh

React – Django page is blank on refresh Question: Hello I am using Django as my backend and React as frontend. I have an issue when I refresh page and I am not on root page ‘/’ the page goes blank. Also If Ill try to go instantly somewhere else then the home page such …

Total answers: 2

Import "rest_framework" could not be resolved. But I have installed djangorestframework, I don't know what is going wrong

Import "rest_framework" could not be resolved. But I have installed djangorestframework, I don't know what is going wrong Question: Here’s my settings.py: INSTALLED_APPS = [ ‘rest_framework’, ‘django.contrib.admin’, ‘django.contrib.auth’, ‘django.contrib.contenttypes’, ‘django.contrib.sessions’, ‘django.contrib.messages’, ‘django.contrib.staticfiles’, ‘api.apps.ApiConfig’ ] Asked By: Harshil Gambhir || Source Answers: If you are using VSCode, Ctrl + Shift + P -> Type and select …

Total answers: 9

Access to fetch `url` been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. ReactJS

Access to fetch `url` been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. ReactJS Question: I’m am trying to fetch a serverless function from a react app in development mode with the following code. let response = await fetch(url, { method: ‘POST’, mode: ‘cors’, body: "param=" + paramVar, }) .then(response …

Total answers: 4