Start the Django backend development server:
Quick Start
cd backend && source venv/bin/activate && DJANGO_DEBUG=True daphne -b 0.0.0.0 -p 8008 server.asgi:application
The backend will be available at http://localhost:8008
Pre-flight Checks
Before starting, verify:
Virtual environment exists:
ls backend/venv/bin/activateIf not, create it:
cd backend && python -m venv venvDependencies installed:
cd backend && source venv/bin/activate && pip freeze | head -5If empty, run:
pip install -r requirements.txtDatabase migrated:
cd backend && source venv/bin/activate && python manage.py showmigrations --plan | grep -c '\[ \]'If non-zero, run:
python manage.py migratePort available:
lsof -i :8008If in use, kill the process or use a different port
Troubleshooting
- "ModuleNotFoundError": Activate venv and install requirements
- "Port already in use": Run
lsof -i :8008and kill the process - "Database locked": Wait for other processes to finish
- WebSocket not working: Ensure using Daphne, not
python manage.py runserver
Source: Hairash/little-dinos-game — distributed by TomeVault.