reactjs

How to build a frontend for my youtube video downloader program?

How to build a frontend for my youtube video downloader program? Question: I want to build a basic frontend for the below program, so that when users enter the app they will get the same output as in a python interpreter. here is the python code from pytube import YouTube def Download(link): youtubeObject = YouTube(link) …

Total answers: 1

why my react hook(usestate) not rendering?

why my react hook(usestate) not rendering? Question: i’m using django restframework for my server side, i have fetch my datas on ReactJS, set it using "setPosts", consoled my response and i am getting my require response but when i try to render it in my return() block. i am not getting the data. rather i …

Total answers: 1

Django issue saving data to database

Django issue saving data to database Question: username is saving but information such as first_name, email and etc are not. `from django.contrib.auth.models import User from django.contrib.auth.password_validation import validate_password from rest_framework import serializers class RegisterSerializer(serializers.ModelSerializer): email = serializers.CharField(required=True) first_name = serializers.CharField(max_length=50, required=True) last_name = serializers.CharField(max_length=50, required=True) password = serializers.CharField( write_only=True, required=True, validators=[validate_password]) password2 = serializers.CharField(write_only=True, required=True) …

Total answers: 2

Project created but its fields are empty when sent from React to Django API

Project created but its fields are empty when sent from React to Django API Question: I’ve been working on this React + Django APP. And I have been making a simple CRUD functionality into this app. everything goes fine but when i came to create project and send it to the django database, it gets …

Total answers: 1

React Router not render

React Router not render Question: I tried using react router but it doesn’t work. I already know that React Router Dom v6 has changed from Switch to Routes but when I run the program it just shows a blank screen. Does anyone know how to fix this? Here is my code: App.js ”’ import React, …

Total answers: 2

FastAPI is not returning cookies to React frontend

FastAPI is not returning cookies to React frontend Question: Why doesn’t FastAPI return the cookie to my frontend, which is a React app? Here is my code: @router.post("/login") def user_login(response: Response,username :str = Form(),password :str = Form(),db: Session = Depends(get_db)): user = db.query(models.User).filter(models.User.mobile_number==username).first() if not user: raise HTTPException(400, detail=’wrong phone number or password’) if not …

Total answers: 1

How to post JSON data from JavaScript frontend to FastAPI backend?

How to post JSON data from JavaScript frontend to FastAPI backend? Question: I am trying to pass a value called ‘ethAddress’ from an input form on the client to FastAPI so that I can use it in a function to generate a matplotlib chart. I am using fetch to POST the inputted text in Charts.tsx …

Total answers: 1

How to manage CORS in Django

How to manage CORS in Django Question: Im trying to connect React.js[axios] and Django [hosting in Heroku] and every time I get this. On my localhosts everything works fine I get all the object except images, but all works fine. Ive allowed my host to connect but it doesn’t work CORS_ALLOW_ORIGINS = [ ‘localhost’, ‘https://itbookcom.herokuapp.com/’ …

Total answers: 3

Fetching data using React to a Python backend

Fetching data using React to a Python backend Question: I am using python (bottle framework) as backend and React as frontend. I want to fetch data from React through "http://127.0.0.1:8080/" using useEffect Hook. The problem is I keep getting: Here is my backend (python) @get(‘/’) def _(): data = { ‘name’: ‘Alvin’, ‘lastname’: ‘Johnson’ } …

Total answers: 1