Full Stack React & Django [1] - Basic REST API
Why Stack Overflow recommends it
Stack Overflow users link it as the starting point for combining React with Django, often citing it for project structure and auth setup in questions and answers.
Recommended by 1 people across 1 different months, 2019 to 2021.
What it is
Part 1 of Traversy Media's Full Stack React & Django series. Brad Traversy sets up a Django project and builds a basic REST API with the Django Rest Framework, testing endpoints with Postman. The later parts add a React frontend, Redux and authentication.
What people said
Recommends JChao · 2021-01 · Stack Overflow · on “Django request.user is still authenticated after logging out”
@JPG yes, the one you can find in Inspect -> Application -> Local Storage. i followed this series of videos to set my auth up [this video]
Cites Aaron Miller · 2019-07 · Stack Overflow · on “Babel 6 regeneratorRuntime is not defined”
I am using a React and Django project and got it to work by using regenerator-runtime . You should do this because @babel/polyfill will increase your app's size more and is also deprecated [LINK] . I also followed this tutorial's [this video] episode 1 & 2 to create my project's structure [LINK] . *package.json* ... "devDependencies": { "regenerator-runtime": "^0.13.3", ... } .babelrc { "presets": ["@babel/preset-env", "@babel/preset-react"], "plugins": ["transform-class-properties"] } index.js ... import regeneratorRuntime from "regenerator-runtime"; import "regenerator-runtime/runtime"; ReactDOM.render(<App />, document.getElementById('app')); ...
Cites Soumya Sharma · 2019-09 · Stack Overflow · on “Why I am not able to create virtual enviroment on a project directory?”
I was following this tutorial on youtube [this video] , when I typed "pipenv shell" it created a virtual environment on my root directory with the name same as my username but I wanted to create virtual env on the project directory. my code snippet [LINK] I didn't want "(ryuk) ryuk@ryuk ~ $" instead I want something like this "(pipenv)ryuk@ryuk ~/github repos/react-django $"
Cites Techoplite · 2020-05 · Stack Overflow · on “500 (Internal Server Error) when fetching from Django Rest API default router (to create object)”
I am trying to make Django and React to work together, and although I have a basic knowledge of Django (I can develop a site), I am just starting to learn React. My project structure is based on this video [this video] which is loosely based on this blog [LINK] in turn. My API works perfectly fine, I can create, retrieve, update, and delete objects without problems. Also, on my frontend, I have managed to correctly display a list of the items from my database, by fetching the related API Url. Just to make it clear, here is the main 'backend' urls.py : from rest_framework import routers from .views import AssessmentViewSet router = routers.DefaultRouter() router.register('api/assessments', Assessm
Cites abramoconnor · 2020-09 · Stack Overflow · on “Django-React/Redux-Apache project: Can't resolve url”
first time building a web app. decided to use django/react with redux and django rest framework for api routing and component state. decided to implement apache as a production server and test locally. when I used the django development server everything worked fine but when I switched to apache I hit an issue. I can get the static content to display at the root url " [LINK] " but can't get any further urls to resolve. On the main page of this app there's a component that, when it mounts, calls a url (GET) ".../api/buildings" to populate the component with some data but the server responds with a 404 or 500 but didn't when I used django dev server. I can't figure out what I'm doing wrong and
Cites Shamar Yarde · 2021-04 · Stack Overflow · on “Share auth between django and react”
Once the user logs in, get the token from the backend using the following: axios.post(` [LINK] { headers: { 'Content-Type': 'application/json', data: { username, password }) .then(response => { console.log(`token: ${response.token}`); }) Port number could be 8000 and url pattern could be /api/auth/login for example. This answer mostly comes from the last reference. References Youtube. Full Stack React & Django [1] - Basic REST API. [this video] . (Accessed 23 April, 2021). Youtube. Full Stack React & Django [2] - Implementing React. [LINK] . (Accessed 23 April, 2021). Youtube. Full Stack React & Django [3] - Redux & HTTP. [LINK] . (Accessed 23 April, 2021). Youtube. Full Stack React & Django [4]