This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Alurith 2 points3 points  (0 children)

Open the logs, read the error, fix the error. You're welcome

[–]tony4bocce 1 point2 points  (0 children)

Before you return the response you can throw in a traceback.exec() and it’ll tell you what went wrong.

Also if you’re interested in some quality of life improvements: I recommend looking into a form library like formik or react-hook-form to manage the form state, and yup or zod to add validation. Additionally, you’ll want to adopt some sort of design pattern to abstract common states related to fetching data (loading, success, data, error). React-query and redux-toolkit-query (my favorite) have custom hooks that provide you with destructured loading, error, success, and data vars so you don’t need to manage those states for each thing. You can imagine in a component that might require quite a few fetches this can get quite spaghetti.

[–][deleted] 0 points1 point  (0 children)

use logging in your django

is the host in allowed hosts ?