Skip to content

Instantly share code, notes, and snippets.

Eric Fries EricFries

Block or report user

Report or block EricFries

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View python_pr.md

Django Performance Guidelines

ORM

  • Incorrect usage of the Django ORM is a common cause of performance issues. Therefore, it is important to know when querysets are evaluated (i.e., hit the database)
  • Use exists() to check if a queryset has any results in it.
    • Good:
     queryset = Account.objects.filter(some_attribute=True)
    
View gist:1441eede2f85dd0cde4a
♥ git checkout -b experimental-theories
Switched to a new branch 'experimental-theories'
You can’t perform that action at this time.