Build a basic REST API to manage employees in a company, focusing on CRUD operations, RESTful principles, and authentication.
- Create, list, retrieve, update, and delete employee records.
- Filtering by department and role.
- Pagination for employee listing.
- Token-based authentication for secure access.
- Proper error handling with HTTP status codes.
This Employee Management API effectively implements CRUD operations while adhering to RESTful practices. It provides robust error handling and authentication, ensuring secure and efficient management of employee records. Postman simplifies testing by allowing users to easily validate each endpoint and scenario.
Before running the application, ensure you have the following installed:
- Python (3.7 or higher)
- pip (Python package manager)
- Postman or similar tool for testing API endpoints
- Database (e.g., PostgreSQL, MySQL, or SQLite)
- Django Rest Framework: Web framework for building the API.
- PostgreSQL: For storing and retrieveing the data.
- Postman: For Testing of API Endpoints.
-
Clone the repository:
git clone https://github.com/yourusername/employee-management-api.git cd employee-management-api -
Create a virtual environment: python -m venv venv source venv/bin/activate # On Windows use
venv\Scripts\activate -
Install the required dependencies:
pip install -r requirements.txt
-
Set up the database (follow instructions in DATABASE.md if available).
-
Run the application: python manage.py runserver