A production-ready quickstart project combining Django (Python backend) with React TypeScript (frontend).
- Django Backend: RESTful API with best practices
- React TypeScript Frontend: Modern SPA with type safety
- User Management: Custom user model with Django's authentication system
- Example App: Demonstrates Django app structure and API integration
- Production Ready: Configured for Heroku deployment with automatic builds
- Static Files: Optimized static file handling with WhiteNoise
django-react-quickstart/
├── quickstart_project/ # Django project settings
├── example/ # Example Django app
├── frontend/ # React TypeScript app
├── templates/ # Django templates
├── requirements.txt # Python dependencies
├── package.json # Node.js build configuration
├── Procfile # Heroku process configuration
└── app.json # Heroku app configuration
- Python 3.10+
- Node.js 18+
- Git
- Clone the repository:
git clone <your-repo-url>
cd django-react-quickstart
- Create and activate virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install Python dependencies:
pip install -r requirements.txt
- Install Node.js dependencies and build frontend:
npm install
npm run build
- Run migrations:
python manage.py makemigrations
python manage.py migrate
- Create superuser:
python manage.py createsuperuser
- Start development server:
python manage.py runserver
For frontend development with hot reload:
cd frontend
npm run dev
- Create a new Heroku app:
heroku create your-app-name
- Set environment variables:
heroku config:set SECRET_KEY="your-secret-key"
heroku config:set DEBUG=False
heroku config:set ALLOWED_HOSTS="your-app-name.herokuapp.com"
- Deploy:
git push heroku main
The deployment process will automatically:
- Install Node.js dependencies
- Build the React TypeScript frontend
- Install Python dependencies
- Run database migrations
- Collect static files
You can also deploy directly to Heroku using the deploy button:
GET /api/examples/
- List all example itemsGET /admin/
- Django admin interfaceGET /
- React frontend
SECRET_KEY
- Django secret key (required)DEBUG
- Django debug mode (default: True in development)ALLOWED_HOSTS
- Comma-separated list of allowed hostsDATABASE_URL
- Database connection string (automatically set by Heroku)
- Backend: Django 5.2, Django REST Framework patterns
- Frontend: React 19, TypeScript, Vite
- Database: PostgreSQL (production) / SQLite (development)
- Deployment: Heroku with automatic buildpacks
- Static Files: WhiteNoise for efficient static file serving
- Environment-based configuration
- CSRF protection enabled
- Secure user authentication
- Production-ready security headers
- Secret key management
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
MIT License - see LICENSE file for details.