These are chat archives for django/django

Feb 2018
Feb 14 2018 04:47
@Cosbgn It is better to include what is the current output and what is the expected output
Marios Panagopoulos
Feb 14 2018 15:25
hi one fast question max_id = Example.objects.latest('id').id is causing an error when Example table is empty
what should i do ?
try except: didnt work
Feb 14 2018 20:18
@MariosPanag max_id = getattr(Example.objects.latest('id').values('id'), 'id', None)
try something along those lines
Saba Khukhunashvili
Feb 14 2018 20:36
Hi guys. how do i check birthday of user in background and send a birthday wish to his/her email (even if user is not online on website)? can you guys PLEASE give me a good resource to learn more about this?
Feb 14 2018 20:38
you are looking for async tasks. there are many different options on how to do them. for example you can have a cron process running every 24 hours that triggers a management command from django (which goes through users and sends the appropriate emails).
your first step is to make a management command: - that goes through users, finds ones with bday today and sends them emails
then your next step is to not have to trigger it manually every day... and there are several approaches, just google for django async tasks and find a solution that works for you
Saba Khukhunashvili
Feb 14 2018 20:39
Thank you so much. That's exactly what i was looking for.
Feb 14 2018 20:40
honestly I've never done it before as I'm new to these stuff as well, but i've been reading about it quite a lot and there are just so many approach to this...
there are also some django packages that make it easier, eg:
Feb 14 2018 22:24
Hi everyone, i’m looking for a beginner’s tutorial on Django. I know python and flask. Looking for any resources on django