Sergey
I want to update one model item from $_POST.
First I get it: human = Humans.objects.get(pk=id)
May I update record from array, not by fields like:
human.name = post_data['name']
I test human.set and human.update - but it doesn't work as I want
Anonymous
pls
Anonymous
help
Anonymous
Exception Value:
No module named 'whitenoise'
Anonymous
Exception Type: ModuleNotFoundError
inchidi
New member? then you've been muted for 5 minutes to read the rules properly before doing anything, please don't PM anyone asking why you were muted!
By joining this group, you agree with the Django Code of Conduct
Here are some resources to start with django
if you're Iranian, you are globally restricted, we can't do anything about it, sorry.
inchidi
inchidi
Anonymous
Error in the interpreter, because of this, static styles are not loaded.
Anonymous
have you install that package with pip?
AbdulAhmad
Hi and how are you all. I'm new and thanks from your group
Shubham
Hello , I have extended the user model and created 2 class , stud and teacher
Shubham
how to add the extra field in child classes
Shubham
https://dpaste.de/oShx
Shubham
is this right way?
Ярик
hey guys, can some1 tell me how to change default django admin header text with an own logo image
Mirco
Ярик
got you
Mirco
Brian
Hello guys. I am trying to handle authentication
Mirco
Sunnat
Hello guys
Sunnat
as in django print html file
Sunnat
simple example
Sunnat
???
Mirco
I think you should study Django from the beginning
Alaa
hi guys am trying to make a contact us form with django and react
Alaa
i made an api using DRF
Alaa
and the first problem that it was giving me this page when submiting
Alaa
Reason given for failure:
CSRF token missing or incorrect.
Alaa
and i have add this to react
Alaa
import React from "react";
import Cookies from "universal-cookie";
const cookies = new Cookies();
var csrftoken = cookies.get("csrftoken");
const CSRFToken = () => {
return <input type="hidden" name="csrfmiddlewaretoken" value={csrftoken} />;
};
export default CSRFToken;
Alaa
but now it's giving me this error when submiting
Alaa
his page isn’t working If the problem continues, contact the site owner.
inchidi
your user authenticated? session base or token base?
Alaa
and i didn't put on the form to be redirected anywhere i wanted to stay at the same page
Alaa
i didn't make any user auth till now
Alaa
still on the main page of the site
Alaa
just want to make the contact us
inchidi
its rest project right? share your views
Alaa
the backend i think it's working because i can make a post request to the api i made with postman
cj
Alaa wanted to post this long code: https://hastebin.com/ibeqekahos
Alaa
Alaa
Alaa
inchidi
do you know how to check the request sent by your js code?
Alaa
on the network ?
Alaa
devtoold
Alaa
devtools?
inchidi
on the network ?
yeah, check the headers, make sure you use correct content type Content-Type: application/json
Alaa
Access-Control-Allow-Origin: *
Allow: POST, OPTIONS
Content-Length: 20
Content-Type: application/json
Alaa
the problem that when i try to submit the form it's redirecting to the other page and that is wierd
Anonymous
If it's react in the frontend it's the default behaviour of the form
Anonymous
To redirect to post somewer
Anonymous
U can stop this using e.preventDefault()
Alaa
I have put it now and still doing this
Anonymous
How to use the template from external sources and use it with my django form? I actually did all the static files and and the other things but now i am having functionalities related problem
Shiva
Guy I m getting error as "pylint(no member)"
Ярик
guys, does somebody know how to change admin pannel font size??
Mirco
Shiva
Mirco
Shiva
Mirco
Mirco
cj
Mirco
Shiva
Mirco
😧
If u think your code is correct, you can always disable pylint warning for that line to quick "fix" 😁
Shiva
Ярик
Thanks
African Coder
Alaa
POST http://127.0.0.1:8000/api/contacts/ 400 (Bad Request)
Alaa
here trying to make a post request to an api i made with restframework