Timezone
Always enable timezone.
TIME_ZONE = 'Asia/Kolkata'
USE_TZ = True
If you are using MySQL, see the Time zone definitions section of the MySQL notes for instructions on loading time zone definitions.
How to get current utc time ?
Always use this way because its timezone aware.
How to get localtime ?
What does is_aware, is_naive, make_aware, make_naive do?
More info https://docs.djangoproject.com/en/1.8/topics/i18n/timezones/
Prefetch Related
Prefetch related wont work if you call .values_list() in for loop.
Case where Prefetch Related is working fine
Case where Prefetch Related is not working fine
Other
- Never define settings in lower case.
- Always use django-debug-toolbar, it shows how many queries you are exceuting.
Coming Soon
Anurag Jain
Share it, If you enjoyed this post.