Archives for

PYTHON

error: command ‘cc’ failed with exit status 1; Can’t install PIL, Pillow, MySql and other packages in Mavericks.

If you are getting the following error when installing python packages using PIP or easy_install, don’t worry. You have come to the right place for solution. First make sure you have developer tools installed. You can install them by executing the following command in terminal xcode-select –install The clang errors are due to changes introduced in

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:

Error whil creating super user in django1.4 on MAC

I got the following error while trying to create a super user from shell for django1.4. File “/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py”, line 85, in get_system_username     return getpass.getuser().decode(locale.getdefaultlocale()[1]) TypeError: decode() argument 1 must be string, not None This problem was rectified by running this command in terminal before adding the user export LANG=”en_US.UTF-8″ I’m guessing this character encoding