A clean Django REST API boilerplate with JWT authentication, custom user model, and essential endpoints to kickstart your project.
- Django 4.2.23 + Django REST Framework
- JWT Authentication with Simple JWT
- Custom User Model (email-based login)
- User registration, login, and profile management
- Password reset functionality
- CORS support
- Docker support
# Clone and setup
git clone https://github.com/samirpatil2000/django-boiler-plate.git
cd django-boiler-plate
cp .env.example .env
# Run with Docker
docker-compose up --build
# Setup database
docker exec -it backend python manage.py migrate
docker exec -it backend python manage.py createsuperuser
# Clone and setup
git clone https://github.com/samirpatil2000/django-boiler-plate.git
cd django-boiler-plate
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies and setup
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Base URL: http://127.0.0.1:8000/account/
POST /register
- Register new userPOST /login
- Login and get JWT tokenPOST /token/refresh
- Refresh JWT tokenGET /register
- Get user profile (requires auth)
GET /password-reset
- Request password resetGET /password-reset-confirm/<uidb64>/<token>
- Confirm resetGET /password_change
- Change password form
curl -X POST http://127.0.0.1:8000/account/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepass123",
"password2": "securepass123"
}'
curl -X POST http://127.0.0.1:8000/account/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepass123"
}'
curl -X GET http://127.0.0.1:8000/account/register \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
- Custom User Model: Email-based authentication instead of username
- JWT Authentication: Secure token-based authentication
- Modular Design: Clean separation of concerns
- API-First: RESTful API architecture
The project supports both PostgreSQL and SQLite3 databases. Configure via the DB_ENGINE
environment variable in your .env
file:
SQLite3 (Default):
DB_ENGINE=sqlite3
PostgreSQL:
DB_ENGINE=postgresql
DB_NAME=your_db_name
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
DB_PORT=5432
# Run tests
python manage.py test
# Access admin panel
http://127.0.0.1:8000/admin/
- Set
DEBUG = False
in settings - Configure production database (PostgreSQL/MySQL)
- Set up environment variables in
.env
- Configure static files and HTTPS
- Update CORS settings for your domain
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details.