Shaun
system dependencies aren't needed for 90% of the work.
Arjun
response = HttpResponse(csv_file, content_type='text/csv; charset=utf8')
Yes.. this can be done if I’m using a view for loading a file right? In my case I’m just using something like profile.profile_pic in the template which will be a url only of the s3 object
George
Arjun
In model I have profile_pic = ImageField(<path to s3 bucket>) This is the only thing we are setting. And yes, I’m also passing the binary object to the backend from the browser. The object automatically gets uploaded to s3 but for webp the wrong content type is set.
Anders (izzno / gooood) 🇳🇴
Reverse?
Anders (izzno / gooood) 🇳🇴
I was on my cell but did you make sure "def get_absolute_url" is correct
George
hi, i'm in a crisis now
George
i got an imagefield whose value is undefined
Mirco
Share the code 😀
George
Well, mmm i dont get what specifically to share
George
I what case would i get undefined in an imagefield?
George
I looked the entry in dbeaver and all images where ok (the path) and only one got undefined
Mirco
How do you call it ? Undefined from js ?
George
No
George
Undefined in postgres
Mirco
Ah ok, strange
George
Mmmm
Mirco
Try to debug with pdb ( breakpoint() with py3.7)
George
hmmm
Mirco
Yes , Python debugger
cj
pdb?
are you using any IDE?
George
emacs
cj
emacs
maybe you can integrate it with breakpoint(), idk
George
yes, i know there is a debugger but i havent used it
George
the thing is the problem is on database
George
i can't reproduce
cj
the thing is the problem is on database
use the debugger to trace the variable to see where it turns to 'undefined'
George
mmmmm
George
the thing is i don't know the images involved
George
and im fucked up
cj
the thing is i don't know the images involved
but you know where the variable is and where it goes
Mirco
You wrote that piece of code, you should know the flow 😂
cj
what do you mean?
use the debugger in the POST function, where the variable gets its value, then follow the flow and you will see magic
cj
hmmmm i'm not convinced
🙄 debugger is ❤️, you should use it
Mirco
Yep ahah and I love that py3.7 wraps pdb set trace with breakpoint()
George
yes but, i don't think i will help me
George
ok, im gonna explain
Mirco
if you have ipdb will it use it?
Mmm I don't really know, we should check on py docs
George
i got a image upload field, then i just save it to imagefield into my media folder but i got undefined
George
the thing is i don't know the image that caused the undefined
cj
Mmm I don't really know, we should check on py docs
I was just curious 😄 I use ipdb when needed instead of pdb
George
but what should i debug
George
i don't get it
George
your code
my code is correct, it works
Mirco
i got a image upload field, then i just save it to imagefield into my media folder but i got undefined
That's why you should use the debugger on your view , to check every line of that piece of code
George
otherwise i don't know how to test it because if i got 1 failure in 600
George
and it's not guaranteed to fail when i find the image involved
Mirco
it uses pdb only
Open issue or make a PR for ipdb support 😂
cj
Open issue or make a PR for ipdb support 😂
I'll do when George uses the debugger 🤣
Mirco
Of course 😂
George
i don't know how to do the debugging fk
George
because the saving process was done not by me
George
it was my client
George
how do you suggest for me to do the debug process?
cj
how do you suggest for me to do the debug process?
use your IDE's debugger if there's one, else use ipdb, or breakpoint()
George
NO
George
i mean the actual testing process
George
i can learn the debugger but im thinking my actual problem
George
do i get just random images and test them?
cj
i mean the actual testing process
use the debugger in the piece of code you think there is the bug
George
yes ugh
George
but i need to fix first my actual problem
cj
or automate testing using selenium or similar
George
later i will do sth related
cj
yes ugh
that means you don't write unit test while you code? 😱