A Django-based web application to manage a list of people with functionality to filter, search, and paginate through records.
Django Filters is a reusable Django application that allows developers to create user-friendly interfaces for filtering Django querysets. This application provides a powerful and flexible way to create custom filters that can be used to narrow down the results displayed on a webpage based on specific criteria defined by the user.
- Features
- Installation
- Usage
- Running the Project
- Populating the Database with Fake Data
- Technologies Used
- License
- Filter and search by name, age, gender, and date created.
- Paginate results to manage large datasets.
- Bootstrap integration for responsive design.
Follow these steps to get a copy of the project up and running on your local machine.
- Python 3.x
- pip (Python package manager)
- virtualenv (Recommended for Python environments)
-
Clone the repository
git clone https://github.com/yourusername/django-person-management.git cd django-person-management
-
Create and activate a virtual environment
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the required packages
pip install -r requirements.txt
-
Create a superuser (optional, for admin access)
python manage.py createsuperuser
-
Run the development server
python manage.py runserver
-
Access the application
Open your web browser and go to
http://127.0.0.1:8000/
. -
Admin Dashboard
Access the admin dashboard at
http://127.0.0.1:8000/admin/
using your superuser credentials.
- The home page displays a list of people with filtering options.
- Use the form at the top to filter by ID, name, age, gender, and creation date.
- Pagination is available for navigating through large datasets.
To quickly populate the database with 100 fake Person
records, use the custom Django management command:
-
Run the populate command
python manage.py populate_people
This command uses the Faker library to create 100 random entries in the database.
- Django: A high-level Python web framework that encourages rapid development and clean, pragmatic design.
- Django Filters: Used for creating filters for querysets in Django.
- Faker: A Python package that generates fake data for testing purposes.
- Bootstrap: A front-end framework for faster and easier web development.
This project is licensed under the MIT License - see the LICENSE file for details.