Django REST framework (DRF) and Angular 2+ tutorial (Part 2)
In this post we will give you information about Django REST framework (DRF) and Angular 2+ tutorial (Part 2). Hear we will give you detail about Django REST framework (DRF) and Angular 2+ tutorial (Part 2)And how to use it also give you demo for it if it is necessary.
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.
Django REST framework (DRF) with Angular 2+ tutorial (Part 1)
Django REST framework (DRF) with Angular 2+ tutorial (Part 2)
Django REST framework (DRF) with Angular 2+ tutorial (Part 3)
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 .
Hope this code and post will helped you for implement Django REST framework (DRF) and Angular 2+ tutorial (Part 2). if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs