Skip to content

Rest API in Django Framework for getting company's data about all entity

Notifications You must be signed in to change notification settings

aalok-kumar-yadav/restApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restApi

This project contains a company's database and we will retrieve all the useful and wanted data in JSON format.First we need to create a Djnago Project and then created a webapp namely companies.

install djangorestframework in python

pip install djangorestframework

after installing include in the installed apps

we need to create database(if not exist) in model and migrate all changes database

RDBMS TABLES

  • Employee
  • Department
  • Projects
  • Dependent
  • Workson
  • Worksfor
  • Dependent_Of
  • Controls

Steps

  1. after this we have to create a serializers class for all class of database this actually provides the wrapping in a specific format like JSON instead of simple python objects.

  2. creating view is necessary for response for specfic url patterns so create a generic view simple view for HTTP Response.

  3. To complete all steps when we run a url in localhost we get JSON Fomat data in browser.

Here is the sample output of the retrived data of all Employee with their attibutes like name, address, sex etc and this information we can easily send over the newtwork.

alt text

Here is the sample output of the retrived data of all Project with their attibutes like location, project name etc and this information we can easily send over the newtwork in JSON format.

alt text

About

Rest API in Django Framework for getting company's data about all entity

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages