https://github.com/joacod/django-playground
Django playground
https://github.com/joacod/django-playground
django python3
Last synced: about 1 month ago
JSON representation
Django playground
- Host: GitHub
- URL: https://github.com/joacod/django-playground
- Owner: joacod
- License: mit
- Created: 2025-07-10T10:53:01.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-16T00:52:05.000Z (11 months ago)
- Last Synced: 2025-07-19T11:10:13.800Z (11 months ago)
- Topics: django, python3
- Language: JavaScript
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Playground
[](https://github.com/joacod/django-playground/blob/main/LICENSE)
[](https://www.python.org)
[](https://www.djangoproject.com)
[](https://react.dev/)
[](https://www.docker.com/)
## ๐ Introduction
Full-stack Django project with React frontend, containerized with Docker for seamless development.
### Tech Stack
- ๐ **Backend**: Django + Django REST Framework + PostgreSQL
- โ๏ธ **Frontend**: React + Vite + Tailwind CSS
- ๐ณ **Development**: Docker + Docker Compose
### Development Features
- โ
**Django**: Python code changes restart the server automatically
- โ
**React**: Frontend changes update instantly in the browser
- โ
**Database**: PostgreSQL with persistent data across restarts
## ๐ Quick Start (2 minutes)
### Prerequisites
Docker & Docker Compose installed
### Get Started
1. Create environment file **".env"** from **".env.example"**
2. Start everything with one command
```bash
docker-compose up --build -d
```
3. Access your applications
- ๐ Django: http://localhost:8000
- โ๏ธ React Frontend: http://localhost:5173
That's it! Both applications are running with live reloading. ๐
## ๐ป Development Commands
Apply Django database migrations
```bash
docker-compose exec web python manage.py migrate
```
View logs
```bash
docker-compose logs web -f # Django logs
docker-compose logs frontend -f # React logs
```
Fresh start (removes database data)
```bash
docker-compose down -v && docker-compose up --build
```
## ๐ ๏ธ Admin Panel
Create a superuser for Django admin
```bash
docker-compose exec web python manage.py createsuperuser
```
Access admin at: http://localhost:8000/admin
## ๐๏ธ Database Management with pgAdmin
Analyze and manage your PostgreSQL database using pgAdmin web interface.
### Access pgAdmin
1. **Open pgAdmin**: http://localhost:5050
2. **Login credentials**:
- Email: `admin@admin.com`
- Password: `admin`
### Connect to PostgreSQL Database
1. Click **"Add New Server"** or **"Create > Server"**
2. **General tab**:
- Name: `Django Playground` (or any name you prefer)
3. **Connection tab**:
- Host name/address: `db`
- Port: `5432`
- Maintenance database: `django_playground`
- Username: `django_user`
- Password: `django_password`
4. Click **"Save"**
## ๐ Choosing Your Development Approach
This project supports **both** Django development approaches:
### ๐ **Django Templates Approach**
- **What**: Traditional server-side rendered HTML pages
- **Access**: http://localhost:8000
- **Use case**: Classic Django web applications with server-side rendering
### โ๏ธ **API + React Frontend Approach**
- **What**: Django REST Framework APIs + React SPA
- **Access**:
- API: http://localhost:8000/api/
- Frontend: http://localhost:5173
- **Use case**: Modern decoupled architecture with React consuming DRF APIs
## ๐งช Testing
Run Django REST framework tests
```bash
docker-compose exec web python manage.py test -v 2
```
## โ๏ธ Did you like the project?
You can collaborate with me giving a star โญ๏ธ to the project or
[](https://www.buymeacoffee.com/joacod)
Thanks! ๐