Get up and running with Health Tracker in 5 minutes!
# 1. Clone and navigate
git clone https://github.com/AndrewTr0612/DjangoTestingHealthApp.git
cd DjangoTestingHealthApp/project
# 2. Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# 3. Install dependencies
pip install -r src/requirements.txt
# 4. Setup database
cd src
python manage.py migrate
# 5. Start server
python manage.py runserver
# 6. Open http://localhost:8000 in your browser# 1. Clone and navigate
git clone https://github.com/AndrewTr0612/DjangoTestingHealthApp.git
cd DjangoTestingHealthApp\project
# 2. Create virtual environment
python -m venv .venv
.venv\Scripts\activate
# 3. Install dependencies
pip install -r src\requirements.txt
# 4. Setup database
cd src
python manage.py migrate
# 5. Start server
python manage.py runserver
# 6. Open http://localhost:8000 in your browsergit clone https://github.com/AndrewTr0612/DjangoTestingHealthApp.git
cd DjangoTestingHealthAppcd projectLinux/Mac:
python3 -m venv .venv
source .venv/bin/activateWindows:
python -m venv .venv
.venv\Scripts\activatepip install -r src/requirements.txtDependencies installed:
- Django 5.2.7
- python-decouple 3.8
- Other core libraries
cd srcCreate .env file (optional - has defaults):
SECRET_KEY=django-insecure-development-key
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0python manage.py migrateThis creates:
- User tables
- UserProfile
- WeightEntry
- WeightGoal
- ChatMessage
python manage.py createsuperuserFollow prompts to create admin account.
python manage.py runserverYou should see:
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Navigate to: http://localhost:8000
- Click "Register" button
- Choose username and password
- Enter email (optional)
- Click "Sign Up"
- Enter your height (cm)
- Select gender
- Enter date of birth (optional)
- Click "Save Profile"
- Click "Add Weight" in navbar
- Enter current weight (kg)
- Add notes if desired
- Click "Add Weight Entry"
- Click "Set Goal" in navbar
- Choose goal type:
- Lose Weight
- Gain Weight
- Maintain Weight
- Enter target weight
- Select pace (slow/moderate/fast)
- View timeline calculation
- Click "Set Goal"
- See current weight & BMI
- View progress to goal
- Check weight trend chart
- Monitor timeline
- Click blue chat button (bottom-right)
- Ask questions:
- "What should I eat?"
- "Give me workout tips"
- "Show meal prep ideas"
- "I need motivation"
# Use different port
python manage.py runserver 8080
# Or kill process on port 8000
# Linux/Mac:
lsof -ti:8000 | xargs kill -9
# Windows:
netstat -ano | findstr :8000
taskkill /PID <PID> /F# Make sure virtual environment is activated
# Linux/Mac:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
# Reinstall requirements
pip install -r src/requirements.txt# Delete database and recreate
rm db.sqlite3
rm -rf account/migrations/0*.py
rm -rf chatbox/migrations/0*.py
# Recreate migrations
python manage.py makemigrations
python manage.py migrate# Collect static files
python manage.py collectstatic --noinput-
Create superuser (if not done):
python manage.py createsuperuser
-
Access admin panel:
http://localhost:8000/admin -
Login with superuser credentials
-
Manage:
- Users
- Profiles
- Weight Entries
- Goals
- Chat Messages
✅ User authentication & registration
✅ Profile management (name, email, height, DOB)
✅ Weight tracking with history
✅ Automatic BMI calculation
✅ Goal setting with timeline calculator
✅ Progress tracking dashboard
✅ Interactive weight trend charts
✅ Health advice chatbox (no API needed!)
✅ Responsive design (mobile-friendly)
✅ Floating chat widget
- Login -
/accounts/login/ - Register -
/accounts/register/ - Dashboard -
/accounts/dashboard/ - Edit Profile -
/accounts/profile/edit/ - Add Weight -
/accounts/weight/add/ - Set Goal -
/accounts/goal/set/ - Admin Panel -
/admin/
Edit templates/base.html:
:root {
--primary-color: #667eea; /* Change this */
--secondary-color: #764ba2; /* And this */
}Edit chatbox/gpt.py:
self.diet_tips = [
"Your custom diet tip here",
# Add more...
]- Create view in
account/views.py - Add URL in
account/urls.py - Create template in
templates/accounts/ - Update navbar in
templates/base.html
- Django Docs: https://docs.djangoproject.com/
- Bootstrap Docs: https://getbootstrap.com/docs/
- Chart.js Docs: https://www.chartjs.org/docs/
Solution:
pip install python-decoupleSolution: Make sure you're using {% csrf_token %} in all forms
Solution: Check browser console for JavaScript errors. Make sure Chart.js CDN is accessible.
Solution: Complete all required profile fields (height, gender)
Your Health Tracker is now running at http://localhost:8000
Next Steps:
- ✅ Register your account
- ✅ Setup your profile
- ✅ Add your first weight entry
- ✅ Set a goal
- ✅ Start tracking your progress!
- Track daily for best results
- Set realistic goals (0.5-1kg/week)
- Use the chatbox for motivation
- Check dashboard weekly
- Try meal prep ideas from chatbox
- Follow YouTube channels recommended
You're ready to start your health journey! 💪
For detailed documentation, see README.md
Questions? Open an issue on GitHub!