November 11, 2016

Why Python and Django, you ask?

Why Python and Django, you ask?

Well. Python doesn't necessarily make coding awesome, but gives you the tools to write awesome code. Which feels awesome. You can find a quick and easy demonstration of what Pythonic/Djangonic code can feel like here:

send_to = list()

for friend_id in users:
    friend = User.objects.get(pk=friend_id)
  except User.DoesNotExist:
  if friend.push_notification_token:
    send_to.append((, friend.apn_token))


send_to = [(, f.apn_token) for f in User.objects.get(pk__in=users, apn_token__isnull=False)]

Feels good! So much productive. Wow.

A good read with examples on what 'Pythonic' is, can be found here:, written by Martijn Faassen.