π§© User API Project (Django REST Framework)
A clean, modular, and secure Django REST API for user management, authentication, filtering, and search. This project was built using Django 5, Django REST Framework, and django-filter.
π Features β User Management
Register new users
Login with token authentication
Update profile
Delete account
π Custom Permissions
Restrict access based on authenticated user
Prevent users from editing othersβ data
π Filtering & Search (Day 25)
Search users by username, email
Filter by is_active, date_joined, etc.
Built with django-filter
π¦ API Endpoints Method Endpoint Description POST /api/register/ Create a new user POST /api/login/ Obtain auth token GET /api/users/ List all users (with search & filter) GET /api/users// Retrieve a user PUT /api/users// Update DELETE /api/users// Delete π οΈ Technologies Used
Python 3.13
Django 5.2
Django REST Framework
Django Filter
SQLite3 (default DB)
π Project Structure user_api_project/ βββ accounts/ β βββ models.py β βββ serializers.py β βββ views.py β βββ urls.py β βββ permissions.py β βββ filters.py βββ user_api_project/ β βββ settings.py β βββ urls.py βββ manage.py
βοΈ Installation & Setup 1οΈβ£ Clone the repository git clone https://github.com/banumariwan/user_api_project.git cd user_api_project
2οΈβ£ Create virtual environment python -m venv .venv
3οΈβ£ Install dependencies pip install -r requirements.txt
4οΈβ£ Run migrations python manage.py migrate
5οΈβ£ Start the server python manage.py runserver
π§ͺ Testing the API
You can test endpoints using:
Postman
cURL
Thunder Client
DRFβs browsable API (default)
π Search & Filter Examples Search by username: /api/users/?search=banu
Filter by active users: /api/users/?is_active=True
Combine: /api/users/?search=mar&is_active=True
π License
This project is licensed under the MIT License.