Category Archives: Web Development

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 … Continue reading

Posted in Django, PYTHON, Web Development | Tagged , , , | Leave a comment

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 … Continue reading

Posted in OSX, PHP, Web Development | Tagged , | Leave a comment

Unable to connect mysql on OSX form PHP

If you are unable to connect to mysql from PHP and you are sure that MYSQL is running, then try changing your host name from localhost to 127.0.0.1

Posted in OSX, PHP, Web Development | Tagged | Leave a comment

Djnago | 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): … Continue reading

Posted in Django, PYTHON | Tagged , , , | Leave a comment

Restrict Django Templates From Deleting Data.

Django allows method calls inside template system. Though this is an useful feature, some of the methods will have side effects. Mostly the ones that alter data. Say, for instance, you have a UserAccount object that has a delete() method. … Continue reading

Posted in Django, PYTHON | Tagged , , | 1 Comment

What do Dollar and Caret ( $ and ^) sign in Django urls mean?

$ and ^ are regular expression characters that have a special meaning: the caret means “require that the pattern matches the start of the string,” and the dollar sign means “require that the pattern matches the end of the string.” … Continue reading

Posted in Django, PYTHON | Tagged , , , | Leave a comment

Right way to break Django code for debugguing

Django traceback is a very helpful tool in Django development. It saves us from the boring tasking of writing print statements to track variables. Traceback doesn’t kick when there is no error.  There may be no coding errors but there … Continue reading

Posted in Django, PYTHON | Tagged , , , | Leave a comment

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 … Continue reading

Posted in Django, PYTHON | Tagged , | Leave a comment

How to start stop apache on MAC OSX

start Apache apachectl start Stop Apache apachectl stop Restart Apache apachectl restart If the above commands don’t work, try these /etc/init.d/httpd start /etc/init.d/httpd stop /etc/init.d/httpd restart You can also start the web server from the system preferences. Open system preferences, … Continue reading

Posted in Apache | Tagged | Leave a comment

Where is httpd.conf file in Mac OSX Lion

On mac httpd.conf file is located in the directory /etc/apache2/. You can access it through terminal if you want to navigate to it through finder, on finder toolbar goto go->go to folder and type in /etc/apache2

Posted in OSX, Web Development | Tagged , , | Leave a comment