Keith Dechant's Blog

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.

Objectives

In this article, we will see how to:

By Keith Dechant, Software Architect
June 22, 2017

AngularJS Query String handling using $location.search()

Note: This article refers to AngularJS v1.x only. If you're working with Angular 2 or above, take a look at the ActivatedRoute class, which can provide similar functionality. Updated on June 9, 2017.

Many times while developing an Angular app, you will find yourself displaying data in tables and filtering or sorting it. There are many tutorials out there to show you how to use Angular filters and ng-repeat to do this.

By Keith Dechant, Software Architect
June 9, 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

In my previous article, Angular 2: HTTP, Observables, and concurrent data loading, we investigated querying data from an API endpoint using Angular 2's Http service and the Observable pattern. In this second article, we will look at using Http to save data to our API endpoint.

Consider the Angular 2 service we created in the previous article, DemoService:

By Keith Dechant, Software Architect
July 5, 2016

Instant reload with Django, NPM, and Browsersync

Here at Metal Toad, we are starting to use NPM as a task runner to automate our development processes. This tutorial shows how to automate CSS compilation and instantly reload the browser when files change.

Objectives

In this post, we will be setting up an automated local build environment with the following goals in mind:

By Keith Dechant, Software Architect
February 23, 2016

Angular 2: HTTP, Observables, and concurrent data loading

Angular 2 provides a new pattern for running asynchronous requests, called Observables. Here, we will review a few of the concepts and eventually see how to run multiple concurrent HTTP requests, with the callbacks running only after all of them have completed.

Author's note, November 24, 2016: Updated for final Angular 2.0 API. Updated on June 5, 2017.

By Keith Dechant, Software Architect
January 5, 2016

AngularJS: Adding a user-friendly default option to ng-options

Note: This article refers to AngularJS v1.x only. Angular 2 and above use a different templating syntax and these instructions do not apply.

Angular's ng-options directive provides a nifty way to build a select element based on an array in your scope. It can even bind the options to objects in the array, not just string values. But its handling of default values can be a bit puzzling.

If you ever find that your bound value doesn't match any of the available options, you could end up with this bit of inscrutable content in your DOM:

By Keith Dechant, Software Architect
November 3, 2015

Drupal 8 Migrations, part 4: Migrating Nodes from Drupal 7

Note: Now updated for Drupal 8.2!

Drupal 8 provides a flexible, plugin-based architecture for migrating data into a site. In Part 3 of this series, we explored how to migrate taxonomies from a Drupal 7 site. We will now expand on this by migrating basic nodes from a Drupal 7 site into Drupal 8.

By Keith Dechant, Software Architect
December 11, 2014

Drupal 8 Migrations, part 3: Migrating Taxonomies from Drupal 7

Note: Now updated for Drupal 8.2!

Drupal 8 provides a flexible, plugin-based architecture for migrating data into a site. In Part 2 of this series, we explored how to migrate users from a Drupal 7 site. We will now expand on this by migrating Taxonomy vocabularies and terms from a Drupal 7 site into Drupal 8.

By Keith Dechant, Software Architect
December 11, 2014