Django show sql query in shell

To show sql query in python manage.py shell, we use this code import logging l = logging.getLogger('django.db.backends') l.setLevel(logging.DEBUG) l. »

Author image Kien Nguyen

Authentication django-tastypie in right way

When using django-tastypie, I got some problems with security. In my pinterest-clone application, I build a pin model. A pin is a image with a description and tags for it`

»

Author image Kien Nguyen

Mysql without password

When dealing with database, sometime we want to make backup database. I usually use mysqldump to store all database in sql file. The problem is when running, mysqldump ask us to provide password. If you must enter password everytime you run the command, you cannot make it run automatically with crontab script

»

Author image Kien Nguyen

Use `grep` command to find content in Linux

$> grep -r -in "SENTRY" --include=*.py . -R : recursive -in: show line and color –include: only find files with pattern “*.py” . : the directory we will find in »

Author image Kien Nguyen

Watch directory change with Python watchdog library

Watchdog is Python API and shell utilities to monitor file system events.

Watchdog come with a tool call watchmedo to call shell command when we get change on a directiory. The “change” include: delete/modify/create a file in directory.

»

Author image Kien Nguyen