cj
people never learn 🙄
Денис
people never learn 🙄
It's not the matter of knowledge, it's the matter of culture
Денис
probably they can touch anyone where they live
cj
probably they can touch anyone where they live
that makes things even weird 😣
Doragonsureiyā
❎ cj pardoned Brian for: Link to Telegram group or channel (0/3)
cj
@larrb be careful, use a backtick ` to wrap @property when you send a message
Brian
okay.. Those are many rules? Can i post a stackoverflow link to provide context?
cj
okay.. Those are many rules? Can i post a stackoverflow link to provide context?
it's a weird thing about @property because someone parked that username as a channel and the bot detects it as promotional link so better use a backtick when you have @<something> in your messages, and yes, you can post SO links
Brian
awesome. Got it!
Brian
I've also noticed you can't use the (source=something) argument
Brian
My question is, have there been any changes made and have not yet been updated on the docs?
Brian
Any one else experienced a similar issue?
cj
what version of Django and DRF are you using? 🤔
Brian
and Django==2.1.1
Rajat
How can i make web application in django which scans QR code nd send that data directly to database. Is there anyone who can share there views on this topic??
Shaikha
Hi
Shaikha
How can I filter a nested serializer in DRF?
Shaikha
And then how do I use in EndPoint URL?
R
Hi I'm trying to learn django
R
But im facing some problem at mysql connection
R
Please help me I'm don't know where I do mistakes
Sagar
You have to replace the sqlite config with MySQL in settings.py
Code
But im facing some problem at mysql connection
U can also use PostgreSQL database.
R
You have to replace the sqlite config with MySQL in settings.py
Yes I replaced the sqlite config with mysql config and also installed mysql but it's not work
Sagar
Upload your settings.py in Pastebin
R
Mysql is not install
R
But i installed it
Денис
But i installed it
probably you haven't installed a Python lib for that. Like psycopg2 for Postgres
R
I install mysqlclient for mysql at pycharm
Anonymous
Feeling
Anonymous
NoReverseMatch at /blog/ Reverse for 'postdetails' with keyword arguments '{'pk': ''}' not found. 1 pattern(s) tried: ['blog/post/(?P<pk>[0-9]+)$']
Anonymous
what this error indicate
Germinate
https://stackoverflow.com/questions/38390177/what-is-a-noreversematch-error-and-how-do-i-fix-it
Scrim
Hello all. I search on google and other foruns, but i cant resolve this problem. I make model class with FileField , upload_to media folder... all is fine. On template i put form with enctype="multipart/form-data" , but when i try send file the file can be select, but when i try to submit, on web notification appear: Plese select a file.
Scrim
I dont now what im doing wrong, if i put null=True and blank =True, i can upload file
Scrim
i used request.FILES too
Scrim
only null=True and blank=True on class model , i can upload
Scrim
but if remove it, i cant upload file
Yegor
Hi guys how can I read FileField into BytesIO object? I tried to google it but found only opposite result.
Андрей
Open it, read, and write to BytesIO
Yegor
FileField.path
it returns only str object, does it?
Андрей
Yes
Yegor
I use cloud to store files
Андрей
Path to file on filesystem
Yegor
i cant just open it and read
Maz
I use cloud to store files
Which cloud? Aws? Or gcp?
cj
Let me 🦆 DuckDuckGo that for you: 🔎 Celery Django Tutorial
Андрей
I use cloud to store files
Can i ask you to explain, how to do this? Or how to google it?
Yegor
I've found a solution: my_model_instance.my_file_field.open().read()
Yegor
Can i ask you to explain, how to do this? Or how to google it?
1) register at "your favorite cloud service" 2) create a container 3) install library for your cloud to your project 4) set up container, password, token etc 5) PROFIT
cj
🙄
Maz
I've found a solution: my_model_instance.my_file_field.open().read()
👍 I was going to ask if you have resource access in the cloud. Your code may be correct, but if you don't have read/write access in the cloud it won't run.
Marvin
Hello fam. I've been struggling with an encoding issue for a while with my django application. I keep getting an ascii' codec can't encode character '\xf6' in position 63: ordinal not in range(128) Research leading to encoding but nothing seems to work. Anyone with a heads up on what I've overlooked? From submission I get led to the save method. My code :https://pastebin.com/QmWZPzVB
Remy
Quick question guys When you have request.user in your view, and you always need to access its OneToOne relation for example my_products = Product.objects.filter(owner=request.user.shop) Is there a way to avoid that extra SQL query to get the related shop object?
Maz
Can i ask you to explain, how to do this? Or how to google it?
Search for AWS EC2 or Google App Engine with django.
Remy
I don’t remember exactly, but you can prefetch database queries. You can search “prefetch” in django docs
Yes prefetch_related or select_related, I know about these tools, but for request.user where do you use them? lol If it was about doing user = User.objects.select_related(... then it would be fine, but for request.user I guess it is going on at higher level
Денис
I gotta go refresh this topic in my memory
Batman
can anyone help me understand how select_related and prefetch_related work, like are they cached for a particular request or throughout?
Mirco
can anyone help me understand how select_related and prefetch_related work, like are they cached for a particular request or throughout?
Nope, they are related to reduce query when they are One to many and Many to many relations and avoid some duplicate queries when Django tries to link tables
Batman
Nope, they are related to reduce query when they are One to many and Many to many relations and avoid some duplicate queries when Django tries to link tables
yeah i have read that part where it says it performs the JOIN operation instead of querying the database everytime, but let's say I use select_related within a view with Pagination on an object that has ForeignKey, is that the correct usage?
Mirco
everytime you have O2M or M2M is correct to use as you speed up queries
Remy
If the pagination uses the related object yes. If you want to be sure, look at the number of queries before/after
Batman
hmm, I'll try that out, besides, do you guys use multiple settings.py for local and production environment?
Андрей
hmm, I'll try that out, besides, do you guys use multiple settings.py for local and production environment?
i have local_settings.py and import that in my settings.py to override some settings,
Андрей
try: from local_settings import * except ImportError: my_prod_settings