Keith Dechant's Blog

Angular API Calls with Django: Authentication with JWT

Curious about how to make API calls with Angular 6 and the HttpClient service? This tutorial will show you some techniques for building a decoupled micro-blogging application using Angular 6 and the Django Rest Framework (DRF). Along the way, we will learn the following:

  • How to set up the back end of the app using Django and the Django Rest Framework API
  • Creating a simple Angular 6 single-page app which can query the API
  • Authenticating users with JSON Web Tokens (JWT)

Ready? Let's get started!

By Keith Dechant, Software Architect
June 4, 2018

Angular 6: Upgrading API calls to RxJS 6

With the release of Angular 6.0 in May 2018, the framework has been updated to depend on version 6.0 of the RxJS library. RxJS 6.0 has some breaking changes compared to RxJS 5.5 and older, specifically in the handling of some of the methods of the Observable class. This will affect the way Angular developers write API calls and handle other asynchronous processing in the future.

This post outlines some of the changes and how to update your API calls to the new syntax.

By Keith Dechant, Software Architect
May 23, 2018

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

Note to readers, May 18, 2018: the code in this post is built for Angular 5.x. The same techniques will work with Angular 6 as long as you use the rxjs-compat Node package. To see how to upgrade this code for full, native RxJS compatibility, see this post.

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.

Objectives

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