So I finally took a look at the queries I'm generating with Django. Wow, my queries suck. Here's an example of the suckiness:
SELECT `django_site`.`id`,`django_site`.`domain`,`django_site`.`name` FROM `django_site` WHERE (`django_site`.`id` = 1)
SELECT `django_site`.`id`,`django_site`.`domain`,`django_site`.`name` FROM `django_site` WHERE (`django_site`.`id` = 1)
SELECT `django_site`.`id`,`django_site`.`domain`,`django_site`.`name` FROM `django_site` WHERE (`django_site`.`id` = 1)
Three times??
The Django Site module is a funny beast. It consists of a database table with columns id, name, and domain. Then in the settings file, there is a SITE_ID which is used to get the current site from the database.
Umm... Why not just put the site name and domain in the settings file? Why do the database query? Especially since each site already has a unique SITE_ID in the settings file? Is there something I'm missing here?
Brad rewrote this post as:
So there be this bitch of a module for the DJANGO that does site shit but it’s always be like querying the database for the same shits all overs the time over and over again and it be like doing nthing useful so I removed it and then it all did the same thing but without the site module so I recommend to you, by lloyalest readers, that you not to be using it plz k thx.
ThE DNDS.