30 Apr, 15

Install npm packages without sudo

If you run the following command to install npm package:

1
  1. npm install <package_name>

and get an access error, you might be tempted to run this command with sudo and it'll work, but it's not a right way for sure. Npm modules should be installed without sudo. To fix the ...

Read now
29 Apr, 15

Saving file field uploads not in MEDIA_ROOT directory

I had a requirement recently to upload files to some kind of a private directory, not accessible via www. Of course, I used Django model's FileField to solve the task, but the problem was in a fact that by default, FileField saves uploads under MEDIA_ROOT which is not what I ...

Read now
20 Apr, 15

Happy birthday to me and Devel form debug module to you all

I’m turning 32 today. People love birthdays, to me it’s just another line number in a messed stack trace output (philosophy mode enabled).
 
Two years ago I released a drupal module called Get form id (deprecated from now on) that does one small task - it tells you any form's id ...
Read now
09 Apr, 15

If Your Ionic + Android / Crosswalk App Has Stopped Getting Data From a Remote Server Then Read This

If you've enabled crosswalk browser for your Ionic based Android app and it suddenly stopped getting data from requests sent via $http that means that you've been automatically upgraded to Cordova 4.0 and in this version Cordova implements a whitelist policy for navigating the application webview via external plugin (before that ...

Read now
19 Mar, 15

Improve Ionic's Performance in Android With Native Scrolls

Does your Ionic app feel sluggish on scrolls in Android? Well, there's a way to cure that. Ionic has introduced native scrolls in its latest release. In short: native scroll disables Ionic's JS scrolling and releases CPU by handing over the scrolling task to the OS ie Android. As a result ...

Read now
31 Oct, 14

First Steps To Do When You Start A Project With Ionic

Here are the first steps I do when I start developing a mobile app with Ionic Framework. Ionic has a great getting started page where the main steps are perfectly described, but I usually do a little bit more of a setup. Here's my routine:

1) Install Ionic (if you ...

Read now
27 Oct, 14

How To Force Search API To Reindex a Node / an Entity

By default Search API (Drupal 7) reindexes a node when the node gets updated. But what if you want to reindex a node / an entity on demand or via some other hook i.e. outside of update cycle? Turned out it is a quite simple exercise. You just need to ...

Read now
21 Oct, 14

Django Uwsgi Nginx 504 Gateway Timeout

I had a long running process (data import) and encountered 504 Gateway Timeout error. I use Nginx / uwsgi pair to serve my Django app. After doing some research it turned out that the problem is in uwsgi_read_timeout directive. Directive sets the amount of time for upstream to wait for a ...

Read now
09 Oct, 14

AngularJS plus Django: A match made in heaven

I've just finished watching "AngularJS plus Django: A match made in heaven" DjangoCon US 2014 talk by Nina Zakharenko (Video | Slides) and it was quite helpful. Since I'm working with API's and mobile / angular apps a lot, I just made some helpful Django + AngularJS related notes that came out of ...

Read now
19 Sep, 14

Improving Number of Queries Generated by Django Comment's render_comment_list Template Tag

One of my Django apps uses Django Comments. To show a list of comments on a page I use this simple built-in template tag:

1
  1. {% render_comment_list for object %}

All is fine, but I noticed that it loads user object per every comment line. So if you have 50 comments on ...

Read now