Skip to content

a comprehensive, reusable starting point for building professional-grade Django applications. This boilerplate is designed to save developers time by providing pre-built functionalities, essential features, reusable components, and configurations commonly required in modern web applications

License

Notifications You must be signed in to change notification settings

IkramKhan-DevOps/boilderplate-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

86 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Django Boilerplate

A production-ready Django boilerplate with authentication, REST API, and modern tooling.

✨ Features

  • πŸ” Authentication: django-allauth with social login (Google), MFA support
  • πŸ”„ REST API: Django REST Framework with dj-rest-auth
  • πŸ“ Forms: Crispy Forms with Bootstrap 5
  • πŸ“§ Email: Mailchimp Transactional (Mandrill) integration
  • πŸ“± Phone: Phone number field support
  • πŸ” Filtering: Django Filter for querysets
  • πŸ“– API Docs: Swagger/OpenAPI via drf-yasg

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • pip (Python package manager)
  • Git

Installation

Option 1: Using Setup Script (Recommended)

# Clone the repository
git clone <repository-url>
cd boilerplate-django

# Run the setup script
chmod +x docs/bash/setup.sh
./docs/bash/setup.sh

Option 2: Manual Installation

# Clone the repository
git clone <repository-url>
cd boilerplate-django

# Create virtual environment
python3 -m venv venv

# Activate virtual environment
source venv/bin/activate  # On macOS/Linux
# venv\Scripts\activate   # On Windows

# Install dependencies
pip install -r requirements.txt

# Copy environment file
cp docs/configs/.env .env

# Run migrations
python manage.py migrate

# Collect static files
python manage.py collectstatic --noinput

# Create superuser
python manage.py createsuperuser

# Run the development server
python manage.py runserver

πŸ“ Project Structure

boilerplate-django/
β”œβ”€β”€ root/                   # Django project settings
β”‚   β”œβ”€β”€ settings.py         # Main settings file
β”‚   β”œβ”€β”€ urls.py             # Root URL configuration
β”‚   └── wsgi.py             # WSGI configuration
β”œβ”€β”€ src/                    # Application modules
β”‚   β”œβ”€β”€ core/               # Core app (models, helpers, signals)
β”‚   β”œβ”€β”€ services/           # Backend services
β”‚   β”‚   β”œβ”€β”€ accounts/       # User accounts & authentication
β”‚   β”‚   └── dashboard/      # Dashboard functionality
β”‚   └── web/                # Frontend web apps
β”‚       └── website/        # Public website
β”œβ”€β”€ templates/              # HTML templates
β”œβ”€β”€ static/                 # Static assets (CSS, JS, images)
β”œβ”€β”€ media/                  # User-uploaded files
β”œβ”€β”€ docs/                   # Documentation & scripts
β”‚   β”œβ”€β”€ bash/               # Bash utility scripts
β”‚   └── configs/            # Configuration templates
└── manage.py               # Django management script

πŸ”§ Configuration

Environment Variables

The project uses django-environ for environment variable management. Create a .env file in the project root:

cp docs/configs/.env.example .env

Key environment variables:

Variable Description Default
DEBUG Enable debug mode True
SECRET_KEY Django secret key Required
ENVIRONMENT Environment type (local/server) local
DOMAIN Site domain localhost:8000
PROTOCOL HTTP or HTTPS http
ALLOWED_HOSTS Comma-separated list of hosts localhost,127.0.0.1
SITE_ID Django site ID 1
DB_* Database configuration SQLite (local)

πŸ“œ Bash Scripts

All scripts are located in docs/bash/ and can be run from any directory:

# Make scripts executable (first time only)
chmod +x docs/bash/*.sh
Script Description
setup.sh Complete project setup (venv, deps, migrations, static)
migrations.sh Run migrations for all apps
migrations_clean.sh Clean all migration files (with confirmation)
requirements.sh Install/update Python dependencies
static.sh Collect static files
superuser.sh Create admin superuser

πŸ—„οΈ Database Migrations

Run migrations for all apps:

./docs/bash/migrations.sh

Or manually:

python manage.py makemigrations company projects resources services website
python manage.py migrate

Clean migrations (fresh start):

./docs/bash/migrations_clean.sh

πŸ‘€ Admin Access

Create superuser:

./docs/bash/superuser.sh

Default credentials (for development):

Access admin panel at: http://localhost:8000/admin/


πŸ–₯️ Running the Server

Development:

python manage.py runserver

With specific port:

python manage.py runserver 0.0.0.0:8080

πŸ“¦ Apps Overview

App Path Description
company src/services/company/ Company info, team, about pages
projects src/services/projects/ Portfolio and project showcase
resources src/services/resources/ Resources and downloads
services src/services/services/ Service offerings
website src/website/ Main website, homepage, contact

πŸ“„ License

This project is proprietary software owned by Exarth Corporation. All rights reserved.

About

a comprehensive, reusable starting point for building professional-grade Django applications. This boilerplate is designed to save developers time by providing pre-built functionalities, essential features, reusable components, and configurations commonly required in modern web applications

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •