Keith Dechant's Blog

Spatial analysis with PostgreSQL and OpenStreetMap

I've always been a map geek, dating back to the 1980s when I would take a road atlas and some tracing paper and draw in my own road network. And one of my favorite games is to take an old map or globe and try to determine when it was made based on the names and shapes of countries. In the age of online mapping software, big data, and data science, it gets even more interesting. Now I can download the whole data set for the map and write programs against it!

By Keith Dechant, Software Architect
January 8, 2018

Angular 5: Making API calls with the HttpClient service

Angular 4.3 introduced a new HttpClient service, which is a replacement for the Http service from Angular 2. It works mostly the same as the old service, handling both single and concurrent data loading with RxJs Observables, and writing data to an API.

By Keith Dechant, Software Architect
November 27, 2017

Drupal 8 Entity API cheat sheet

Wait, is it "$node->title" or "$node->title->value"? How do I write an EntityQuery again? Yeah, I can never remember, either.

For the developers out there, if you've already read the official Drupal 8 Entity API documentation and you want more examples, here's a handy cheat sheet:

The examples here contain some hard-coded IDs. These are all examples. In your real code, you should already have the node IDs, file IDs, etc. in a variable.

By Keith Dechant, Software Architect
November 22, 2017

Django 2.0 - Is your project ready?

Django 2.0 is in beta now. It's expected to be released in December 2017. The question remains, is the rest of the world going to be ready? Let's take a look at the history of Django versions and see why this might not be as tough of an upgrade as you might expect.

By Keith Dechant, Software Architect
November 6, 2017

Proxying MS SQL connections using PuTTY

Connecting to a Microsoft SQL Server database isn't too hard, most of the time. But, what if the database is in your office, and you want to access it remotely, but you don't have a VPN?

There is another way to connect, using PuTTY and port forwarding. All you need is a server in the office which accepts SSH connections and can connect to the SQL Server. This will serve as a gateway or makeshift proxy server. With the proper port forwarding setup, you can connect to your database from anywhere.

By Keith Dechant, Software Architect
October 28, 2017

Drupal 8: Migrating data from JSON files

The beauty of Drupal 8's built-in Migrate module is its flexibility. Lots of people will likely use it to migrate their Drupal 6 or 7 sites, but that's not all it can do. In fact, it's capable of migrating data from just about any data source PHP can read.

The first few times I used Migrate in Drupal 8, I was migrating data from a MySQL database into Drupal. See my previous posts about the topic here.

By Keith Dechant, Software Architect
October 9, 2017

Hosting Django sites with Apache

Django is a fantastic, powerful web development framework. It's great for development, but hosting it can be a bit of a puzzle. WSGI? Daemon mode? What's going on here?

This article will show you the basics of getting your Django sites running on an Ubuntu server running Apache 2.4.x, using WSGI.


In this article, we will see how to:

By Keith Dechant, Software Architect
June 22, 2017

Secrets to Project Happiness Using Git

I have worked with dozens of projects over my career, on platforms ranging from Drupal to Yii to Django to AngularJS to ASP.NET. Most of them have had a good, solid strategy for how to manage their Git repositories. A few notable ones have not.

Here are a few things I've learned for how to manage your repository to ensure a successful project.

By Keith Dechant, Software Architect
April 11, 2017

URL Routing for a Decoupled App, with Angular 2 and Django

Lately, I have worked on a few projects where a single-page Angular app is contained within a site built on a server-side framework like Django. One of the challenges is to get their URLs to play nicely together.

Say you have a project with an Angular 2 front end and an API back end using the Django Rest Framework. Further, imagine that your Angular 2 page is also served from within the Django app. Your URL structure might look like this:

By Keith Dechant, Software Architect
July 23, 2016

Angular 2: Using the HTTP Service to Write Data to an API

Update, November 27, 2017: This post explains the Http service used in Angular 2. This is now deprecated in favor of the newer HttpClient released in Angular 4.3. This post will remain here as long as Angular 4.x is in long term support. If you are using Angular 5, consider upgrading to the newer HttpClient. You can find a tutorial for the HttpClient service in my post Angular 5: Making API calls with the HttpClient service.

By Keith Dechant, Software Architect
July 5, 2016