Hi again! Many of you asked me about the source code. It's available now at: github.com/hellopyplane/QR-codes-in-Django
@24webdevelopment Жыл бұрын
404 . where is the sourcce code ?
@810Teams4 жыл бұрын
6:20 For those who're having problems with the QR code's image size, replace line 17 with `canvas = Image.new('RGB', (qr_code_image.pixel_size, qr_code_image.pixel_size), 'white')` to make the image size automatically configured. Btw, nice video. This literally saved me quite time!
@Pyplane4 жыл бұрын
Thanks for the comment and for the remark on this! Cheers :)
@rubel14773 жыл бұрын
Thanks
@wolfisraging4 жыл бұрын
Excellent video buddy. Keep it up, KZbin seriously need good Django tutorials like this. Thanks.
@Pyplane4 жыл бұрын
Thank you Wolf!
@rlgraner4 жыл бұрын
Thanks for the video, it helped me a lot. For production, I had to set DEBUG to False, but when debugging is disabled, the image is not displayed. Any idea to solve it.
@Pyplane4 жыл бұрын
Hi Ricardo. You mean qr codes are not displayed or other images as well? I suggest to contact the hosting company customer service and ask for the proper media/static files for production
@rlgraner4 жыл бұрын
Hi@@Pyplane. Thank you very much for your quick response. All images, including the QR code, are not displayed. But that only happens when I change DEBUG to false. The problem also happens on the localhost.
@Pyplane4 жыл бұрын
@@rlgraner for local this is normal if you change debug to false, for going to production remember to fill out allowed hosts in the settings file and contact the hosting customer service to get the right configuration or try to find it online. good luck!
@hervebineli53274 жыл бұрын
@@rlgraner Hi, try to use the package Whitenoise, it will save you from headaches whit serving Django static files in production.
@hervebineli53274 жыл бұрын
Thank you very much for this video. Very clear and very well explaIned. Keep going on that way. I'm one of your followers.
@Pyplane4 жыл бұрын
Thank you very much !! :)
@franciscovinuesa79082 жыл бұрын
How many scans have these qrs ? could you cap those scans ? thank you
@sandeshbthapa26443 жыл бұрын
i was trying to make a form where you type name and it will be saved on out miodels and later we could see that but i dont know how to override the super save function we declared on our models
@Hamza-nu3xj2 жыл бұрын
This is very good example but when we use many to many relationship in models the qrcode doesnt give the tag names properly
@JuanitoOrtega2 жыл бұрын
Thank you. Excuse me, how I can customize the image?.. For example: version, box_size, border?>>>
@Ghuhggyuugh8ijjjjhy4916 Жыл бұрын
thank you from Kazakhstan
@Hamza-nu3xj2 жыл бұрын
How can we use this on many to many relationship?
@olaidealaka68023 жыл бұрын
Just what I was looking for. Thank you!
@Pyplane3 жыл бұрын
Thanks for watching!
@miles25904 жыл бұрын
Hi, do have a video on qrcode scanner using django? since qrcode is generated in djagno, I think, qrcode should be scan using djagno too. that would be great tutorial.
@Pyplane4 жыл бұрын
hi. in order to scan the qr code you need to have access to the camera. In django I don't it's possible. At least I don't know how to do it. It's quite easy if you are a mobile app developer using react native
@miles25904 жыл бұрын
@@Pyplane hi, thank you for the information.
@mehedihasannasim-2 жыл бұрын
you showed the name in qrcode, how can i show more than name from database in qrcode? its just show self.name
@oshershukrun42173 жыл бұрын
Hey dear, Lets say i want to do a reffer to profile1?id=3, profile2?id=5
@mustang174 Жыл бұрын
Excellente video. thanks a lot
@xBrenn4n4 жыл бұрын
Can i edit the qr code url later if i want to change where thw qr code redirects me?
@Pyplane4 жыл бұрын
Hi. The qr code will be updated everytime you save the object. So if you change i.e. website from pyplane.com to youtube.com - the qr code will change
@rahulmullick73164 жыл бұрын
awesome....! sir please build social-media websites....!
@Pyplane4 жыл бұрын
Thank you! :) I will make another social network project this time using django, drf and react js... coming soon :)
@rahulmullick73164 жыл бұрын
@@Pyplane pretty impressive...! i'm waiting for this...! thank you.....!
@oumaymasaddam50003 жыл бұрын
i have this error please help ! AttributeError: 'Settings' object has no attribute 'MEDIA_Root'
@gustinfauziah92313 жыл бұрын
Hi. Thanks for the video. I keep getting an error "TemplateDoesNotExist at /home.html" Please help.
@mamangcikal12554 жыл бұрын
thank u so much bro, but can we do a scan then the scan adds the quantity of an item? thanks for supporting Django community
@Pyplane4 жыл бұрын
Hello Leric. I'm trying to understand what is the purpose of this solution. Besides you will be scaning the qr code with a smart phone, right? If you want to generate more than one QR code you can easily create a qr code generator. It can do a various things... i.e. generate QR codes which are the same (you choose the quantity) or for example you can create random qr codes based on random strings. Regards, Luke
@sakilanasrinsetu10574 жыл бұрын
This video is really awesome. But how to create qr code for multiple data?
@Pyplane4 жыл бұрын
Hi Sakila. I honestly haven't tried that so I can't answer your question
@JesusGil903 жыл бұрын
maybe like string "json" style
@mohamedfowzan88282 жыл бұрын
@@JesusGil90 is there any reference to that? to generate qr code with json string in django?
@mohamedfowzan88282 жыл бұрын
@@Pyplane is there any reference to that? to generate qr code with json string in django?
@bryancirelly81164 жыл бұрын
Hello, excellent content, it was very useful for me to my final project. Now, how can i read a qr code with camera in django?
@Pyplane4 жыл бұрын
Hi Bryan. In django you just create qr codes which you can read by your phone. If you are using iphone you even don't have to install any app - just open up the camera and skan the code :)
@bryancirelly81164 жыл бұрын
@@Pyplane oh bro sorry for my bad explanation, i want to read each qr code inside application to get scanned user profile. How can i do it?
@Pyplane4 жыл бұрын
Bryan Cirelly still not sure I understand (sorry). The qr code should be based on the user profile? I created a qr code based on pyplane.com , in your case I would try to add a qr code to the profile model, so for each user you will have a value to put in the qr code. In example yoursite.com/profile1
@bryancirelly81164 жыл бұрын
@@Pyplane Sorry I'm bad at explaining, I'll try again being a little more specific. I have a patient profile that generates a qr code with their identification number, which would be printed (for when I attend a medical consultation). Within the application I need a scanner that reads the code and sends me directly to your profile. This to automate the search process within the app.
@Pyplane4 жыл бұрын
@@bryancirelly8116 A patient comes, gives you his card where there is a qr code. You then decide to scan it with your phone? Unless you have a mobile app for this - I don't understand it. I would create a barcode generator and buy a scanner for $50, then I would place the barcodes on the patient card (instead of qrcode)...and you don't need your phone, everything can be taken care of from 1 app
@suleymanefecelik87504 жыл бұрын
Thank you so much, but images create twice. How can fix it? (qr-code-a.png and qr-code-a_St8BXhq.png)
@Pyplane4 жыл бұрын
Hi. Check your code to the one on source code available on github. The code presented there saves only one image. Good luck!
@suleymanefecelik87504 жыл бұрын
@@Pyplane I checked. def save(self, *args, **kwargs): qrcode_img = qrcode.make(f'192.168.1.50:8000/a/{self.business.pk}/{self.pk}') canvas = Image.new('RGB', (qrcode_img.pixel_size, qrcode_img.pixel_size), 'white') canvas.paste(qrcode_img) fname = f'qr-code-{self.name}.png' buffer = BytesIO() canvas.save(buffer, 'PNG') self.qr_code.save(fname, File(buffer), save=False) canvas.close() super().save(*args, **kwargs) I can't see any issiue
@suleymanefecelik87504 жыл бұрын
@@Pyplane Ooo I did. Ty :D
@JesusGil903 жыл бұрын
@@suleymanefecelik8750 how did you do it?
@JesusGil903 жыл бұрын
id None -.-
@Pyplane4 жыл бұрын
Hi Guys. Thanks for watching this video! If you're interested in Data Science, I have a FREE DS with Django course on my channel available under this Link: kzbin.info/www/bejne/mH3MlYpqnqesp9E
@nelsonkehinde43034 жыл бұрын
Hi. Thanks for the video. I keep getting an error - "qrcode has no attribute 'make'". Please help.
@nelsonkehinde43034 жыл бұрын
Hi. Please reply
@Pyplane4 жыл бұрын
Hi Nelson. Sorry for the late response. It's difficult for me to say anything without seeing your project code. If you follow the tutorial exactly step by step, such error should not take place. I use quite often qrcodes in the projects that I'm doing and never got such error. Sorry that I can't help on this. Regards, Luke
@nelsonkehinde43034 жыл бұрын
@@Pyplane okay. Thank you. Maybe I did something wrong. I have checked severally times till.... let me do it all over again one more time
@Pyplane4 жыл бұрын
@@nelsonkehinde4303 In case of problems you can write me an email info@pyplane.com
@nelsonkehinde43034 жыл бұрын
@@Pyplane Hi again, I created it all over again step by step and i got it this time. THank you very much. You're wonderful! Lol
@josephsierra19614 жыл бұрын
Hi! This work perfect for string under 15 characters. When i want to convert an string ith 15+ characters it gives me like an off-screen qr that my cellphone cant read. Can u help me?
@josephsierra19614 жыл бұрын
I think that was pretty logic haha Just adjust that 290,290 to bigger values. Thank you for your videos :D
@Pyplane4 жыл бұрын
Hi Joseph. Just tested scanning qr codes with 20 characters - works every time. Difficult for me to write anything more not knowing the details.
@josephsierra19614 жыл бұрын
Ty very muchm Idk why that happened but I fixed it just changing the values to: Image.new('RGB',(360,360), 'white') when creating the canvas.
@Pyplane4 жыл бұрын
@@josephsierra1961 Awesome! Happy you figured it out :)
@alexis31704 жыл бұрын
@@josephsierra1961 Thanks for this, spent hours looking online for answers to why my qrcode couldn't be scanned. Dynamically generating qrcodes in Django is a surprisingly obscure topic.
@vinsmokearifka4 жыл бұрын
Life saver, thanks
@Pyplane4 жыл бұрын
Thanks for watching!
@forumkoding59214 жыл бұрын
How to display the id instead of the item name? I have tried to replace the name with the id but the results are not displayed when the scan is done Thank you very much
@forumkoding59214 жыл бұрын
because I need to be able to display the id when the scan is done
@november_pain3 жыл бұрын
How to make it so photo will be deleted automatically after you delete it from db?
@JesusGil903 жыл бұрын
i think you should read about signals (pre_delete) and delete the file "manually"
@dibri4 жыл бұрын
i need help. doesnt work. cant save in the admin without providing a photo
@Pyplane4 жыл бұрын
Hi. If it doesn't work please check the source code and compare to yours. I'm dropping the link here: github.com/hellopyplane/QR-codes-in-Django
@Pyplane4 жыл бұрын
btw. if you named the qr_code field as photo make sure to set the imagefield as blank=True
@dibri4 жыл бұрын
Hey I already referred to your github but still nothing is there anyway to reach you personally? Maybe discord? Or email?
@MuhammadDavi4 жыл бұрын
you declare draw variabel, but you don't use that....what for draw variable?
@Pyplane4 жыл бұрын
You're right. I was doing experiments with image new and image draw - both solution did work but accidently I added here image draw (although I wanted to present the other solution). You can ignore this line
@MuhammadDavi4 жыл бұрын
@@Pyplane okey, thanks
@MuhammadDavi4 жыл бұрын
@@Pyplane if i want add logo in my qr code, how i can read file image from static folder to my model?
@Pyplane4 жыл бұрын
@@MuhammadDavi it would be easier if you would put the logo and the image to a pdf. That's usually what I'm doing
@MuhammadDavi4 жыл бұрын
@@Pyplane do you have blog or video that I made a reference? thanks
@foresttreehouse2 жыл бұрын
First of all, great video, it really helped me a lot. But after experimenting a little bit I think creating the canvas with Image and ImageDraw isn't actually necessary, it works just the same if you delete all code related to that and replace canvas.save(buffer, 'PNG') with qrcode_img.save(buffer, 'PNG'). Still, I like your approach to the problem so thumbs up!
@alvinng83383 жыл бұрын
Hi, sir, how if i want to have not just Name only from QR code, for example, I want to scan the QR code to retrieve the information of a profile like the username, address, email.... is it possible?
@Pyplane3 жыл бұрын
Hi Alvin. I’m doing the things you mentioned like this: I use the qrcode instead of pk in a mobile app. So once I scan the code a proper screen appears with all the details. We will create a similar app here on the channel in the near future. If you are looking for a different solution you’ll need to do the research on your own. Good luck!