Questions tagged [django-react]

50 questions
3
votes
0 answers

ensure_csrf_cookie method decorator not setting CSRF token in browser cookies tab

I'm working on a project using Django as API backend (hosted on localhost:8000) and React (hosted on localhost:3000) as frontend. My plan is to host them on different servers in production as well. I'm currently trying to set the CSRF token in the…
3
votes
1 answer

How to load react's staticfiles from s3 in django - react

So I have a Django - React application. All the static files are served by s3 I ran npm run build and then i coped the build folder into my django project folder. and then i setup the template dirs and staticfiles dirs in my settings.py file. when…
Shrinidhi Hegde
  • 454
  • 3
  • 14
3
votes
2 answers

ReactJS and DRF: How to store JWT token inside HTTPonly cookies?

Currently, I have the login functionality working on my web app, after I make a login request the server responds with a JSON object that contains 2 tokens: This is the login function: async function login() { const data = { "email":…
Alvaro Bataller
  • 487
  • 8
  • 29
2
votes
1 answer

Fetch data between two dates in React from Django API

I am trying to filter data between two dates and display it in a table. Currently, my table shows all the data from the database but I want the user to be able to select from that date to this date, and data between the specified dates to be…
2
votes
1 answer

When I set CSRF_COOKIE_HTTPONLY = True then 403 (Forbidden) error occurred

In my settings.py: ... CSRF_COOKIE_HTTPONLY = True SESSION_COOKIE_HTTPONLY = True CSRF_COOKIE_SECURE = False CORS_ALLOW_CREDENTIALS = True authenticate.py: from rest_framework_simplejwt.authentication import JWTAuthentication from…
Pradip Kachhadiya
  • 2,067
  • 10
  • 28
2
votes
0 answers

how to pass django params in react components

i am new to react , i am building simple blog where user can post with title and body in html its done with listview with: {% for x in object_list %} {% endfor %} but in react component its not getting good result and showing error here is my…
user15134931
2
votes
1 answer

Update changes on React + Django without running "npm run build" everytime

My Django + React app is integrated fine at least for most parts. Because every time I have to make changes on my React code, in order to apply those changes I have to stop django from running then run npm run build everytime. I've already read this…
CORTIZ
  • 101
  • 1
  • 6
2
votes
1 answer

Using Router vs including url in urlpatterns

Say I am creating a Todo app in Django, traditionally I would include a path to my app in the base_project urls.py file. However, today I came across a tutorial where they used a router for this same purpose I've already stated. Why would I want to…
2
votes
1 answer

Docker - served react app, asset-manifest.json with incorrect filenames

I'm new to web development, and I run into a strange error. I have a React/Django app which I'm trying to productionize with nginx and docker. Django runs on a postgres db, and nginx just reroutes port 80 to my react and django ports. When I locally…
Niels Uitterdijk
  • 713
  • 9
  • 27
2
votes
1 answer

Password: "This field may not be blank." Error with React, ant design and django

Hi I just started learning react and decided to use ant design (version 3), so I created an API (Django Rest Framework) and I got it up an running, my login and sign up page was working fine, so I decided to upgrade ANT Design to Version 4, I had to…
1
vote
0 answers

Why there is extra url adding thing? How can I solve this error?

I am trying to deploy a django-react application. I deployed my backend api and it is working perfectly. I tried to deploy my react frontend using netlify. In localhost all this are working perfectly. I fetched the api from my deployment server. But…
1
vote
1 answer

Django/React - Azure App Service can't find static files

I've deployed my Django React app previously through a dedicated server and now I am trying to achieve the same with Azure Web App function so I can use CI/CD easier. I've configured my project as below but only my django appears to deploy as I get…
1
vote
1 answer

How to encrypt or Obfuscate REST API URL in Django

Hello Django REST API Experts, We are building University Course portals where app offers various user types like Professor, Students and Admins using DJANGO/REACT. We are using REST API to connect between backend and frontend. So, far we are able…
1
vote
3 answers

React App.js doesn't update when making change but other components do

This is my first time using react and I'm using it with Django. I have an index.js that renders the Component App into an id=root element and in the App's body, I have placed an h1 tag and another Component called HomePage which has been imported.…
sam rafiei
  • 51
  • 1
  • 6
1
vote
1 answer

Django-React App Static/Media Serving Method

Me and my friend have started a project including Django, Django REST and React. I have a little experience in deploying standalone django apps but not in django-react. The plan for now is, that the admin will upload pictures via django-admin and…
1
2 3 4