2 Common errors while setting up phpMyAdmin on Mac OSX

You might encounter the following two errors while installing phpMyAdmin on OSX Login without password is forbidden by the configuration ( See AllowNoPassword ) #2002 can not login tot the MySQL server Here are the fixes for the above two errors. 1. Open phpMyAdmin configuration located at (phpMyAdmin Folder)/config.inc.php and change $cfg[‘Servers’][$i][‘AllowNoPassword’] = False; to

Django | Set the defulat ordering rule for queries in the models

Though we can specify order explicitly in queries like below Posts.objects.order_by(‘published’) it is repetitive and most of the times we will want to order by a particular field. We can specify the order in the models like this class Post(models.Model): title = models.CharField(max_length=140) content = models.TextField() published = models.DateTimeField() def __unicode__(self): return self.title class Meta: