This is the second part of a two-part series exploring the use of the Angular 6 HttpClient to make API calls against a Django back-end using Django Rest Framework. In the first part, we learned how to authenticate against Django using the Django Rest Framework JWT package. This post demonstrates how to set up the Django models and views for the micro-blogging app, as well as the Angular Service and templates.
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!
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!
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:
I've been going around town giving a talk on the history of women in computers. During my research, I came across so very many names of women who had made indelible marks on the history of computing that I'd never heard before. I decided that for my inaugural blog post at Metal Toad (Yes, I know I've been here for like over a year now. What? I've been busy!) I would love to do a blog series about these amazing software pioneers who just happen to be women.
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:
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.
In this post, we will be setting up an automated local build environment with the following goals in mind:
Here's part 2 in the series explaining our "full stack" at a high level. If you missed part 1, make sure to give it a read first. If you prefer, you can read the long-form post with all the content in one. Again, feel free to call me on any technicalities or suggest changes/additions in the comments!
For the most part I like to keep my code editors as light and vanilla as possible. Some of the basic features that I like to see in my editor include auto indentation, syntax highlighting and ability to search across the project. Anything that will help debugging my codebase is a plus. Sublime Text offers all of these features out of the box and much more with the addition of community contributed plugins.
This is a quick example of how I got Periodic Tasks to work using Celery without Django. There are lots of examples out there for creating tasks and loose documentation on how to start Celery and Celery Beat, but most of them involve Django. I just wanted to run a simple example and I spent way too long trying to fill in the gaps to get even this simple task to run periodically. So hopefully this quick example will help somebody else out there save some time.