Django REST framework (DRF) and Angular 2+ tutorial (Part 2)
Receive new Django tutorials.
This is part 2 of these tutorial series to learn how to use Python Django framework with Angular 2+ (When writing this second tutorial part It's already Angular 4 ) to create Restful or Rest based web apps.
There are many frameworks or packages to build Rest APIs with Django .In this tutorial we are going to use Django Rest Framework or DRF which makes the process of building restful APIs dead easy .
In the first tutorial part we have seen an introduction to both Django and DRF ,installed Django and DRF then created a new project .
In the second part we are going to first see an introduction to Angular 2+ framework ,next we are going to install the Angular CLI utility and then use it to generate our Angular 2+ project,or precisely Angular 4 project when writing this tutorial.
What is Angular 2 ?
Getting started with Angular 2+
Lets start by installing the Angular CLI so go ahead and open your terminal or command propmt then enter :
npm install -g @angular/cli
Make sure you have NodeJS and NPM installed on your machine .
After successfully installing the Angular CLI lets generate a new Angular 2+ project .
First navigate inside your Django project folder then execute :
ng new client
A new Angular 2+ will be created for you !
You can serve it using ng serve
cd client ng serve
Now you can visit your app by pointing your browser to http:localhost:4000
In the second part of these tutorial series to learn how to use Django Rest Framework or DRF for building a Rest API consumed with an Angular 2+ app ,we have introduced Angular and created the Angular project which makes the client part of our Django project .
Note: We also publish our tutorials on Medium and DEV.to. If you prefer reading in these platforms, you can follow us there to get our newest articles.
You can reach the author via Twitter:Follow @ahmedbouchefra
About the author
Get our Learn Angular 8 in 15 Easy Steps ebook in pdf, epub and mobi formats, plus a new Angular 8 tutorial every 3 days.
Read our other tutorials
- Angular Tutorial
- Laravel 6 Tutorial
- React Tutorial
- React Hooks Tutorial
- React Native Tutorial
- Webpack Tutorial
- PHP Tutorial
- Django Tutorial
- Java Spring Tutorial
- Rails 6 Tutorial
- Ionic 4 Tutorial
- TypeScript Tutorial
- Bootstrap 4 Tutorial
- Electron Tutorial
- Cordova Tutorial
- HTML Tutorial
- GraphQL Tutorial
- CSS Grid Layout Tutorial
- PWA Tutorial