Skip to content

πŸš€ Django Step-by-Step Learning Repository Welcome to the ultimate guide for mastering Django! This repository is designed to take you through Django's intricacies step by step, making the learning process smooth and enjoyable.

Notifications You must be signed in to change notification settings

engrshishir/Django-Portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Django Portfolio Project

GitHub repo size GitHub last commit

πŸš€ Django Portfolio Application

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.

Portfolio Homepage Screenshot

πŸ—οΈ Architecture & Technical Stack

Core Technologies

  • 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

System Architecture

  • 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 functionality
    • Auth: Authentication functionality

βš™οΈ Technical Features

1. Data Modeling

  • 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}'

2. Authentication & Security

  • Django Admin Authentication: Admin interface for content management
  • Form Validation: Form validation with Django
  • CSRF Protection: Standard Django security features

3. Media Management

  • 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

4. Template System

  • Template Inheritance: Base template with extended content pages
  • Context Processors: Template variables for media and request data
  • Responsive Design: Mobile-friendly layout

5. Development Workflow

  • 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 content

πŸ› οΈ Project Structure

Django-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

πŸ“Š Data Models

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)

⚑ Key Features

Custom Management Commands

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_data

Dynamic Content Management

Portfolio content is database-driven, enabling updates through the admin interface:

  • Projects section displays data from the Projects model
  • Services section uses the Services model
  • Testimonials pulled from the Testimonials model

Media Organization

File management includes:

  • Organized path generation by content type
  • Basic file validation (size limits, format restrictions)
  • Structured media directory organization

πŸš€ Development Setup

Configuration

  • Debug Mode: Development configuration with DEBUG=True
  • Static Files: Configured for development environment
  • Django Settings: Standard Django security middleware enabled

πŸ”§ Installation & Setup

  1. Clone the repository:
git clone https://github.com/Engg-Shishir/Django-Portfolio.git
cd Django-Portfolio/project
  1. Create and activate virtual environment:
python -m venv venv
venv\Scripts\activate  # Windows
source venv/bin/activate  # Linux/Mac
  1. Install dependencies:
pip install django
  1. Apply migrations:
python manage.py migrate
  1. Create superuser:
python manage.py createsuperuser --username admin --email [email protected]
  1. Load sample data:
python manage.py create_sample_data
  1. Run development server:
python manage.py runserver
  1. Access the application:

πŸ”„ Project Features

  • 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

If you find this project helpful for your Django learning journey, please star this repository!

About

πŸš€ Django Step-by-Step Learning Repository Welcome to the ultimate guide for mastering Django! This repository is designed to take you through Django's intricacies step by step, making the learning process smooth and enjoyable.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published