A portfolio web application built with Django, implementing common Django features and best practices. This application showcases a personal portfolio website with dynamic content management through Django's ORM.
- Django: Web framework for building the portfolio application
- Python: Core programming language
- SQLite3: Default database for development
- HTML5/CSS3: Frontend design and structure
- JavaScript: UI interactions and responsive design elements
- MTV Pattern (Model-Template-View): Django's architectural pattern for separation of concerns
- Multi-app Structure: Separation of functionality through dedicated Django apps:
app: Core portfolio functionalityAuth: Authentication functionality
- Relational Database Design: Portfolio data models with Django ORM
- Custom Field Validators: File size and type validation for media uploads
- Dynamic Media Path Generation: Organized file path management for uploaded assets
def user_image_path(instance, filename):
# Dynamic path generation for user uploads
_, ext = os.path.splitext(filename)
return f'Author/{instance.username}{ext}'- Django Admin Authentication: Admin interface for content management
- Form Validation: Form validation with Django
- CSRF Protection: Standard Django security features
- Media File Organization: Structured media directories by content type
- Structured Asset Organization: Media categorized by type (Author, Projects, etc.)
- File Validation: Size and format validation for uploads
- Template Inheritance: Base template with extended content pages
- Context Processors: Template variables for media and request data
- Responsive Design: Mobile-friendly layout
- Virtual Environment: Isolated Python environment for dependency management
- Custom Management Commands: Sample data generation for testing
python manage.py create_sample_data # Populates database with sample portfolio contentDjango-Portfolio/
βββ project/
β βββ app/ # Core portfolio functionality
β β βββ models.py # Data models (Author, Projects, Services, etc.)
β β βββ views.py # View controllers
β β βββ urls.py # URL routing
β β βββ management/ # Custom Django management commands
β β βββ commands/
β β βββ create_sample_data.py # Data generation utility
β βββ Auth/ # Authentication system
β β βββ models.py # User models
β β βββ views.py # Authentication views
β β βββ urls.py # Auth URL routing
β βββ media/ # User uploaded content
β βββ static/ # Static assets (CSS, JS, images)
β βββ templates/ # HTML templates
β βββ project/ # Project configuration
β βββ settings.py # Django settings
β βββ urls.py # Main URL routing
β βββ wsgi.py # WSGI application entry point
βββ manage.py # Django management script
The application implements a sophisticated data model with the following entities:
Author 1βββ
β β
β βββ Projects (many)
β β
β βββ Social Links (one)
β β
β βββ Testimonials (many)
β β
β βββ About (one)
β β
β βββ Education (many)
β β
β βββ Experience (many)
β β
β βββ Services (many)
β β
βββββββββ΄ββ Contact Information (one)
The project includes a custom management command for populating sample data:
# Creates sample portfolio data with relationships and media files
python manage.py create_sample_dataPortfolio content is database-driven, enabling updates through the admin interface:
- Projects section displays data from the
Projectsmodel - Services section uses the
Servicesmodel - Testimonials pulled from the
Testimonialsmodel
File management includes:
- Organized path generation by content type
- Basic file validation (size limits, format restrictions)
- Structured media directory organization
- Debug Mode: Development configuration with DEBUG=True
- Static Files: Configured for development environment
- Django Settings: Standard Django security middleware enabled
- Clone the repository:
git clone https://github.com/Engg-Shishir/Django-Portfolio.git
cd Django-Portfolio/project- Create and activate virtual environment:
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/Mac- Install dependencies:
pip install django- Apply migrations:
python manage.py migrate- Create superuser:
python manage.py createsuperuser --username admin --email [email protected]- Load sample data:
python manage.py create_sample_data- Run development server:
python manage.py runserver- Access the application:
- Website: http://127.0.0.1:8000/
- Admin Panel: http://127.0.0.1:8000/admin/
- Portfolio Showcase: Display projects and services
- About Section: Personal details and background
- Contact Information: Contact details and messaging
- Testimonials: Client testimonials section
- Admin Management: Content management through Django admin


