Skip to content

This is Project of REST API for the CRUD method in which I have used the Python, Django, Rest Framework, REST API. The function of this API is to Read, Create new entries, Update the existing entries, and Delete the existing entries with primary key in the database for employee details.

Notifications You must be signed in to change notification settings

rushiaglave/restAPI_CRUD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django REST API for CRUD Operations

This project is a Django-based RESTful API implementation for CRUD operations on employee details.

Table of Contents

Features

  • Implements CRUD operations (Create, Read, Update, Delete) for managing employee details.
  • Utilizes Django Framework and Django Rest Framework for efficient API development.

Installation

  1. Clone the repository:
    git clone https://github.com/rushiaglave/restAPI_CRUD.git
    
  2. Install dependencies:
    pip install djangorestframework
    
  3. Apply database migrations:
    python manage.py migrate
    

Usage

To start the server, run:

python manage.py runserver

Endpoints

  • admin/ - Django administration panel.(username and password both is admin)
  • task-list/ - Get a list of all employees.
  • task-listid/{pk}/ - Get a list of employees by there unique id
  • task-create/ - Create a new employee record.
  • task-update/{pk}/ - Update an employee record by ID.
  • task-delete/{pk}/ - Delete an employee record by ID.

Examples

Create a new employee

POST /task-create/
Content-Type: application/json

{
  "id": 1,
  "firstname": "John",
  "lastname": "Doe",
  "emp_id": 1234
}

Update an employee

PUT /task-update/1/
Content-Type: application/json

{
  "id": 1,
  "firstname": "John",
  "lastname": "Doe",
  "emp_id": 5678
}

Delete an employee

DELETE /task-delete/1/

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

This is Project of REST API for the CRUD method in which I have used the Python, Django, Rest Framework, REST API. The function of this API is to Read, Create new entries, Update the existing entries, and Delete the existing entries with primary key in the database for employee details.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages