Skip to content

This project is a Django REST Framework-based API system that demonstrates core concepts like modular structure, serializers, views, and database integration. It includes separate apps for managing Students and Employees with clean CRUD operations. Designed for learning and scalability, it's a great starting point for building RESTful backends.

Notifications You must be signed in to change notification settings

Dhananjay66/DRF-Project

Repository files navigation

🚀 DRF Basics Project

A beginner-friendly project to help you learn and understand the fundamentals of Django REST Framework (DRF) — covering everything from basic APIs to serializers, views, authentication, and more.


📚 What You'll Learn

  • 🔹 Django REST Framework setup & configuration
  • 🔹 API views: APIView, ViewSet, GenericAPIView
  • 🔹 Serializers & ModelSerializers
  • 🔹 CRUD operations (Create, Read, Update, Delete)
  • 🔹 Pagination & filtering

🌍 Live Demo

🔗 Live URL : Click Here

⚙️ Setup Instructions

Follow these steps to get the project up and running locally:


🧾 1. Clone the Repository

git clone https://github.com/Dhananjay66/DRF-Project.git
cd DRF-Project

🧪 2. Create & Activate Virtual Environment

python -m venv venv
# For Linux/Mac
source venv/bin/activate

# For Windows
venv\Scripts\activate

📦 3. Install Dependencies

pip install -r requirements.txt

🔧 4. Apply Migrations & Run Server

python manage.py migrate
python manage.py runserver

🎉 You're all set! Open your browser and go to http://127.0.0.1:8000/ to see it live.


📦 API Endpoints

Method Endpoint Description
GET /api/v1/employees/ List all employees
POST /api/v1/employees/ Create a new employee
GET /api/v1/employees/{id}/ Retrieve a single employee
PUT /api/v1/employees/{id}/ Update an existing employee
DELETE /api/v1/employees/{id}/ Delete an employee

🔐 Authentication required for certain routes (if implemented).


🧪 Run Tests

python manage.py test

📁 Project Structure

│
├── manage.py
├── db.sqlite3
├── requirements.txt # List of all Python dependencies
│
├── Django_Rest_Main/ # Main project configuration
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│ └── asgi.py
│
├── api/ # Shared logic or general APIs
│ ├── admin.py
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
│ ├── urls.py
│ └── migrations/
│
├── students/ # App for managing student data
│ ├── models.py
│ ├── views.py
│ ├── urls.py
│ ├── admin.py
│ └── migrations/
│
└── employees/ # App for managing employee data
├── models.py
├── views.py
├── admin.py
└── migrations/

✨ Useful Commands

# Create superuser for admin access
python manage.py createsuperuser

# Create migrations
python manage.py makemigrations
python manage.py migrate

🤝 Contributing

We love contributions from the community!

  • 🐞 Found a bug? Open an issue.
  • 🚀 Want to add a new feature? Fork the repo and submit a PR.
  • 📄 Make sure to update documentation if needed.
  • ✅ Please test your code before submitting.

Thank you for making this project better! 💖


🧑‍💻 Author

@Dhananjay66


📄 License

This project is licensed under the MIT License — see the LICENSE file for details.


📧 Contact

For any query or collaboration:
📧 [pratapsinghd665@gmail.com]

About

This project is a Django REST Framework-based API system that demonstrates core concepts like modular structure, serializers, views, and database integration. It includes separate apps for managing Students and Employees with clean CRUD operations. Designed for learning and scalability, it's a great starting point for building RESTful backends.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published